Forum Discussion
Excellent
Nov 09, 2026Copper Contributor
How to change the columns a formula will get its data from
Here is a dummy example of what my spreadsheet looks like, the end date/time can be in different columns based on external factors. a b c d 1 Start date/time Other date/time End date...
Harun24HR
Nov 09, 2026Silver Contributor
There are few ways to achieve this. Here are few-
=XLOOKUP(1,B2:C2,B2:C2,,1,-1)-A2
=TAKE(FILTER(B2:C2,B2:C2<>""),,-1)-A2
=INDEX(A2:C2,1,MAX((B2:C2<>"")*COLUMN(B2:C2)))-A2Time difference based on last row.