Forum Discussion
cklingel
Feb 08, 2022Copper Contributor
Calculating a difference for lab results for only those with more than one result
Hello, Is there a way to calculate the difference in values for an individual only if there is more than one value for a particular referred value? For example I have the test results for over 1000...
OliverScheurich
Feb 08, 2022Gold Contributor
=XLOOKUP(D2,$A$2:$A$8,$B$2:$B$8,,,-1)-XLOOKUP(D2,$A$2:$A$8,$B$2:$B$8,,,)This formula works as shown in my spreadsheet.
In D2 i entered the formula:
=UNIQUE(A2:A8)
cklingel
Feb 08, 2022Copper Contributor
Thank you for your quick help. When I run the D2 formula I received #SPILL errors so after correcting received values not consistent with what they should be. For instance, Patient A had two results so his result difference should have been 0.1% but I am getting 561?
patientid labdate labvalue Column1
A 2/27/2020 0.056 37647 561.00
A 9/10/2021 0.057
patientid labdate labvalue Column1
A 2/27/2020 0.056 37647 561.00
A 9/10/2021 0.057