T. Valko wrote:
>> 23:10 07:45 = 9.666666667
>
> The correct result is 9.583333333
>
>> 23:10 07:45.....(It should be 9.5 by using 23:15 07:45)
>> 21:05 11:30.....(It should be 15.5 by using 21:00 11:30)
>
> Instead of rounding the times, round the final result.
>
> Try this:
>
> =IF(COUNT(A1:B1)=2,ROUND((B1-A1+(B1<A1)+1/24)*24/0.25,0)*0.25,"")
>
>> One hour needs to be added
>
> That's what this is doing: +1/24
>
> Biff
Cheers Biff, that works perfectly. I just used it on a s/shet I'd already
done and it matched my figures every time. This'll save me a few hours a
day... to do the other work!
Rob
>
> "Rob S" <(E-Mail Removed)> wrote in message
> news:x_Syh.8360$(E-Mail Removed)...
>> Hi Group,
>>
>> Please could you give me an all singing, all dancing formula, or an
>> explanation of how to put these together.
>>
>> A1 B1
>> 23:00 07:30 =IF(B1<A1,B1+1,B1)-A1
>>
>> This gives me the hours and minutes 8:30 in C1 (Format/Custom/HH:MM)
>> One hour needs to be added so... =C1+01:00 gives me 09:30 in D1
>> (Format/Custom/HH:MM)
>> Then I need it dislayed in decimal format =D1*24 which gives me 9.5
>> in E1(Format/General)
>>
>> It's not actually set out like that A1 B1 C1 D1, with the result I
>> need in E1, but it makes it easier to explain.
>>
>> It's not urgent, as I already have the calculator working, I'd just
>> like to use this function elsewhere :-)
>>
>>
>> Next on the list is how to round up and down, for when the hours are
>> not as straightforward, I round them to the nearest 1/4 of an hour,
>> for example
>>
>> 23:10 07:45 = 9.666666667 (It should be 9.5 by using 23:15 07:45)
>> 21:05 11:30 = 15.41666667 (It should be 15.5 by using
>> 21:00 11:30) Can all of this be put in one formula?
>>
>> These functions will be used on a spreadsheet and the final values
>> copied across to another spreadsheet, so it doesn't matter if extra
>> columns need to be created or hidden.
>>
>>
>> Can you help?
>>
>> Cheers
>>
>> Rob
|