Can't figure out formula for duration on gSheet

Viewed 19
2 Answers

Use this formula

=IF(A2="",, SORTN(IF(
            COUNTIF(B$2:B2, "="&B2)>1=TRUE, 
            SORTN(FILTER(A$2:A2,B$2:B2=B2 ), 2, , 1, 0), A2),1,,1,1))

enter image description here

Use the formula in E2

=IF(B2="", ,IF(XLOOKUP($B2,$B$1:$B1,$A$1:$A1,"-",0,-1)="-","First time worker",$A2-XLOOKUP($B2,$B$1:$B1,$A$1:$A1,,0,-1)))

And drag it down till the end of the sheet

Related