LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default Rounding Error when Calculating similar times

I have been scouring the web trying to find out why there is a difference in
the way Excel does some rounding.

I am using this formula:
=ROUNDUP(IF(A1B1,(B1+1-A1)*96,(B1-A1)*96),15)

I have it pasted to three sets of cells (C1, C2, C3)

My data is:
A1 = 11:00
A2 = 12:30

B1 = 23:00
B2 = 00:30

C1 = 10:00
C2 = 11:30

Cells A1, A2, B1, B2, C1, C2 have the format of hh:mm.

Cells C1, C2, C3 display the value out to 18 decimal places.

In each situation we have 1 hour and 30 minutes of difference. But the
value shown in the cells a
C1 = 6.000000000000010000
C2 = 5.999999999999990000
C3 = 6.000000000000000000

Because of this difference in the way the rounding is accomplished the my
larger formula gives different answers.

My full formula is:
=IF(E30="CB", IF(((ROUNDUP(IF(B30C30,(C30+1-B30)*96,(C30-B30)*96),0)/96*24)
<= 0.5), 1,
IF(AND(((ROUNDUP(IF(B30C30,(C30+1-B30)*96,(C30-B30)*96),0)/96*24)<=2),(0.500001<=(ROUNDUP(IF(B30C30,(C30+1-B30)*96,(C30-B30)*96),0)/96*24))),
2,
IF(B30="","",IF(C30="","",ROUNDUP(IF(B30C30,(C30+ 1-B30)*96,(C30-B30)*96),0)/96*24)))),
IF(B30="","",IF(C30="","",ROUNDUP(IF(B30C30,(C30+ 1-B30)*96,(C30-B30)*96),0)/96*24)))

It should show the time interval in a decimal format to two decimal places.

But the above full forulma gives these values:
C1 = 1.75 (incorrect)
C2 = 1.50 (correct)
C3 = 1.50 (correct)

Can you give me an idea how I can do a work around of this problem?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Averaging times (similar to lap times) cqmman Excel Discussion (Misc queries) 1 June 22nd 07 11:15 PM
Calculating time difference then rounding down Angel Excel Discussion (Misc queries) 4 May 17th 07 09:16 AM
Rounding times to the nearest 15 minutes in Excel BuckeyeWMV Excel Discussion (Misc queries) 8 April 3rd 07 10:28 PM
Calculating times gibbylinks Excel Discussion (Misc queries) 4 August 23rd 05 01:27 PM
Avoiding typing similar formula 600 times Ian D. Weatherall Excel Worksheet Functions 5 June 29th 05 06:51 AM


All times are GMT +1. The time now is 06:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"