Calculate a sum or difference of two columns, only if both columns are not blank

How would I write an expression to perform this calculation only if both of these columns are not blank?

[On Site Date Time]-[En Route Date Time]

 

I was thinking maybe something like:

AND(ISNOTBLANK([On Site Date Time]), ISNOTBLANK([En Route Date Time])), [On Site Date Time]-[En Route Date Time]

Pretty sure I'm on the right track, but don't know exactly what do to

Solved Solved
0 2 87
1 ACCEPTED SOLUTION

Good call!

Here's the final

IFS(AND(ISNOTBLANK([On Site Date Time]), ISNOTBLANK([En Route Date Time])), [On Site Date Time]-[En Route Date Time])

View solution in original post

2 REPLIES 2

Depending on where and what you're trying to accomplish, you likely need to wrap the expression you already drafted within an IF or IFS function.

Good call!

Here's the final

IFS(AND(ISNOTBLANK([On Site Date Time]), ISNOTBLANK([En Route Date Time])), [On Site Date Time]-[En Route Date Time])

Top Labels in this Space