Hi,
I have a cell (TotalTime1) that references two other time formatted cells (Start1 and Finish 1).
The below formula is intended to tell the difference between the Start and Finish time if they are populated.
I had it working without the HasValue condition but the formula was calculating when there was no value in Start1 and Finish1 (due to time format).
This is the code I do have, it says there is an error near the last line; I am sorry if I post this in the wrong manner, I have not posted on this forum before but here goes:
if (HasValue (Finish1) and HasValue (Start1)) then if (Time2Num(Start1.formattedValue, "HH:MM") < Time2Num (Finish1.formattedValue, "HH:MM")) then Abs (Time2Num(Start1.formattedValue, "HH:MM") - Time2Num(Finish1.formattedValue, "HH:MM")) / (60 * 60 * 1000) else 24 - Abs (Time2Num(Finish1.formattedValue, "HH:MM") - Time2Num(Start1.formattedValue, "HH:MM")) / (60 * 60 * 1000) endif
Any help would be appreciated.
Regards Fetachini