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
- Customer Resources
- 65.2K Get Help
- 445 Global Discussions
- 143 Industry Talk
- 476 Announcements
- 5K Ideas & Feature Requests
- 84 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!