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
Solved! Go to Solution.
Views
Replies
Total Likes
you need another endif at the end (you have a nested if statement and only 1 endif)
Views
Replies
Total Likes
you need another endif at the end (you have a nested if statement and only 1 endif)
Views
Replies
Total Likes
Thanks whyisthisme,
Your speedy response is greatly appreciated, your support has resolved my issue.
Many thanks.
Regards
Fetachini
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies