Formula to pull data from two lines into one line (same sheet)

Hi,

I wanted to see if it is possible to have a formula that uses data from two different rows within the same sheet based on certain criteria? Any help would be much appreciated. Thank you!

I tried to explain it via the visualization below.


Best Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    edited 03/18/24 Answer ✓

    Try something like this:

    =IFERROR(INDEX(COLLECT([Lab Temp Column]:[Lab Temp Column], Type:Type, @cell = "LAB", Date:Date, @cell = Date@row, [LAB Number]:[LAB Number], @cell = [LAB Number]@row), 1), 0) - IFERROR(INDEX(COLLECT([Desk Temp Column]:[Desk Temp Column], Type:Type, @cell = "Desktop", Date:Date, @cell = Date@row, [LAB Number]:[LAB Number], @cell = [LAB Number]@row), 1), 0)

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    You missed the Type:Type range in each of the COLLECT functions. That is where we specify to pull the "LAB" for the first and the "Desktop" for the second.

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    edited 03/18/24 Answer ✓

    Try something like this:

    =IFERROR(INDEX(COLLECT([Lab Temp Column]:[Lab Temp Column], Type:Type, @cell = "LAB", Date:Date, @cell = Date@row, [LAB Number]:[LAB Number], @cell = [LAB Number]@row), 1), 0) - IFERROR(INDEX(COLLECT([Desk Temp Column]:[Desk Temp Column], Type:Type, @cell = "Desktop", Date:Date, @cell = Date@row, [LAB Number]:[LAB Number], @cell = [LAB Number]@row), 1), 0)

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

  • alexis.ray89371
    alexis.ray89371 ✭✭✭✭✭

    thank you for responding although I don't think it quite gets me there. i used the below formula:

    =IFERROR(INDEX(COLLECT([Temperature Taken in Laboratory by Thermostat]:[Temperature Taken in Laboratory by Thermostat], Date:Date, @cell = Date@row, [LAB Number]:[LAB Number], @cell = [LAB Number]@row), 1), 0) - IFERROR(INDEX(COLLECT([Temperature taken from Metasys Desktop]:[Temperature taken from Metasys Desktop], Date:Date, @cell = Date@row, [LAB Number]:[LAB Number], @cell = [LAB Number]@row), 1), 0)

    In the example below the variance should equal 4


  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    You missed the Type:Type range in each of the COLLECT functions. That is where we specify to pull the "LAB" for the first and the "Desktop" for the second.

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

  • alexis.ray89371
    alexis.ray89371 ✭✭✭✭✭

    you are absolutely right! thank you. appreciate your help. 😁

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Happy to help. 👍️

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!