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
-
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)
-
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.
Answers
-
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)
-
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
-
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.
-
you are absolutely right! thank you. appreciate your help. 😁
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.4K Get Help
- 364 Global Discussions
- 200 Industry Talk
- 430 Announcements
- 4.4K Ideas & Feature Requests
- 137 Brandfolder
- 129 Just for fun
- 128 Community Job Board
- 446 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 284 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!