Date Formula Empty - Invalid Parameter Error

Hello, I have a simple date formula that I am using that calculates the amount of hours worked between two given dates. This is working fine. The issue I am having is on the items without a clock out date, it is throwing an invalid parameter error. I am using an IF statement.

IF({Confirm Clock Out Date_Time}=“”,“”,DAYS({Confirm Clock Out Date_Time},{Confirm Clock In Date_Time})*24)

I have also tried IF({Date} <> 0 and that also creates the same errors.

Hey Scott!

This is a tricky one! If you still need some help getting this resolved, we recommend chatting with our support team as we have some great formula wizards :woman_mage: :magic_wand: that could help resolve this!

You can reach out to them here.

Hi Scott,

Try:

DAYS(IF({Confirm Clock Out Date_Time}="",{Confirm Clock In Date_Time},{Confirm Clock Out Date_Time}),{Confirm Clock In Date_Time})*24

This will give you 0 should Clock out be empty. If instead you’d rather have the column be empty:

IF(DAYS(IF({Confirm Clock Out Date_Time}="",{Confirm Clock In Date_Time},{Confirm Clock Out Date_Time}),{Confirm Clock In Date_Time})*24=0,"",DAYS(IF({Confirm Clock Out Date_Time}="",{Confirm Clock In Date_Time},{Confirm Clock Out Date_Time}),{Confirm Clock In Date_Time})*24)

 
 


Curious to know how that same formula would look in the Advanced Formula Booster, the 3rd party app that makes it so easy to write formulas, does not use the Formula column but rather can write to any type of columns?
You would use the STOP() function to stop the execution of the formula on the first line if the date is empty. Then use the HOURS() function. Much simpler!

Hi @GCavin thanks for the response. This (I tried both of your options) produces the same result as before. Giving me a parameter error when {confirm clock in} and {confirm clock out} are blank.

Please post the formula you’re using.

@GCavin here is the formula I am currently using:

IF({Confirm Clock Out Date_Time}=“”,“”,DAYS({Confirm Clock Out Date_Time},{Confirm Clock In Date_Time})*24)

Here are the other ones that I have tried (all producing the same result):

IF({Confirm Clock Out Date_Time} <> “”,DAYS({Confirm Clock Out Date_Time},{Confirm Clock In Date_Time})*24, “”)

DAYS(IF({Confirm Clock Out Date_Time}=“”,{Confirm Clock In Date_Time},{Confirm Clock Out Date_Time}),{Confirm Clock In Date_Time})*24

IF(DAYS(IF({Confirm Clock Out Date_Time}=“”,{Confirm Clock In Date_Time},{Confirm Clock Out Date_Time}),{Confirm Clock In Date_Time})*24=0,“”,DAYS(IF({Confirm Clock Out Date_Time}=“”,{Confirm Clock In Date_Time},{Confirm Clock Out Date_Time}),{Confirm Clock In Date_Time})*24)

The last 2 work for me:

@GCavin - I have three date columns. When an employee clocks in for the day, their time goes into the “Clock In Date_Time” column and “Confirm Clock In Date_Time” and “Confirm Clock Out Date_Time” are both empty for this item, and these are the ones that are causing the error.

See picture.
Screenshot 2024-01-29 at 8.47.49 AM