Formula Output to be recognized as numbers


#1

Hello! I am trying to do a sum of days! Here is what I have

IF(Delivery=BLANK(),"", DATETIME_DIFF(Return,Delivery,‘days’))

I am getting a number output of the difference of days, (IR: 2, 7, 14) however they are not recognized as numbers because they are in a formula column, therefore I am unable to see the sum of all those days in my column.


#2

Your problem is that explicit empty string in your formula — it causes it to return everything as a string. You can either get rid of it —

IF(Delivery=BLANK(),BLANK(),DATETIME_DIFF(Return,Delivery,'days'))

— or (my preference), make it unnecessary:

IF(Delivery,DATETIME_DIFF(Return,Delivery,'days'))

(The latter version says, implicitly, "IF {Delivery} IS NOT BLANK, DO DATETIME_DIFF(), OTHERWISE BLANK().)