=(a1-a2)-("00:30"*(hour(a1-a2)>8))
Tried that and get #NUM! error
I tried the following, which results in a sum value but it still doesn't pick up the reduction of 0.5 (or 00:30): =((C16-C15)-((C16-C15)>8)-"00:30")*24
What exactly is in A1 and A2?
OK, first that is A1 and B1, unlike your original question, but that aside you have a whole number in C1. Are you multiplying the result by 24 to get a decimal value?
You said you were using A1-A2, but that should result in a time value, not a whole number, please clarify.
What I am trying to say is that you can't get a result of 7.99 unless you convert the time to decimal first.
A straight subtraction will result in 9:00, which is not equal to 9 decimal. It is equal to 9/24 (or 3/8), because Excel stores times as a fraction of a day.
=(A1-B1)-("00:30"*(A1-B1>(1/3)))