Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Behaviour of VBA ROUND function

Hi all,

I have a question of dealing with VBA ROUND function, the question is that
it doesn't do the rounding consistently.

For example:

ROUND(100.5) - 100
ROUND(100.6) - 101
ROUND(100.55,1) - 100.6

Why is that? Is it a bug? Please advise.

Frederick Chow
Hong Kong.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Behaviour of VBA ROUND function

Hi
maybe:
http://www.xldynamic.com/source/xld.Rounding.html#vba

--
Regards
Frank Kabel
Frankfurt, Germany
"Microsoft Forum" schrieb im Newsbeitrag
...
Hi all,

I have a question of dealing with VBA ROUND function, the question is that
it doesn't do the rounding consistently.

For example:

ROUND(100.5) - 100
ROUND(100.6) - 101
ROUND(100.55,1) - 100.6

Why is that? Is it a bug? Please advise.

Frederick Chow
Hong Kong.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Behaviour of VBA ROUND function

How about rounding to the next even value. Wouldn't that be consistent?
? round(101.5)
102
? round(100.5)
100
? round(101.5)
102
? round(102.5)
102
? round(103.5)
104
? round(100.55,1)
100.6
? round(100.45,1)
100.4

Is it a bug?

No
http://support.microsoft.com/default...b;en-us;194983
PRB: Round Function different in VBA 6 and Excel Spreadsheet
--
Regards,
Tom Ogilvy



"Microsoft Forum" wrote in message
...
Hi all,

I have a question of dealing with VBA ROUND function, the question is that
it doesn't do the rounding consistently.

For example:

ROUND(100.5) - 100
ROUND(100.6) - 101
ROUND(100.55,1) - 100.6

Why is that? Is it a bug? Please advise.

Frederick Chow
Hong Kong.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Behaviour of VBA ROUND function

This might be of interest as well:


http://support.microsoft.com/default...b;en-us;196652
How To Implement Custom Rounding Procedures

--
Regards,
Tom Ogilvy


"Microsoft Forum" wrote in message
...
Hi all,

I have a question of dealing with VBA ROUND function, the question is that
it doesn't do the rounding consistently.

For example:

ROUND(100.5) - 100
ROUND(100.6) - 101
ROUND(100.55,1) - 100.6

Why is that? Is it a bug? Please advise.

Frederick Chow
Hong Kong.




Reply
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
Round Function duketter Excel Worksheet Functions 5 February 24th 10 08:46 PM
Round function plantslayer Excel Discussion (Misc queries) 3 June 4th 08 05:49 PM
Round up function shifty Excel Discussion (Misc queries) 3 December 31st 07 11:59 AM
Anomolous behaviour of slope function. ChasX Excel Worksheet Functions 2 March 5th 06 09:16 PM
help with round function Scott Excel Worksheet Functions 7 February 9th 05 07:23 PM


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

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

About Us

"It's about Microsoft Excel"