Forum Discussion

richzip505's avatar
richzip505
Copper Contributor
Sep 23, 2024

Variable cell reference for subtraction formula

Hello,   If I have the below data, I want to find out the total duration on each employee's last day of work.  This would essentially be the end time of the last event, minus the start time of the ...
  • HansVogelaar's avatar
    Sep 23, 2024

    richzip505 

    In D2:

    =IF($A2=$A3, "", $C2-MIN(IF(($A$2:$A$18=$A2)*(INT($B$2:$B$18)=INT($B2)), $B$2:$B$18)))

    Adjust the ranges $A$2:$A$18 and $B$2:$B$18 for your setup.

    Format D2 as a time, then fill down.

Resources