A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

My rounding error in a simple IF



 
 
Thread Tools Display Modes
  #1  
Old August 6th, 2008, 03:08 AM posted to microsoft.public.excel.worksheet.functions
garron
external usenet poster
 
Posts: 2
Default My rounding error in a simple IF

col:A col:B col:C col col:E
4.82 -.02 =4.80 vs 4.80 =0%
why am i getting an error here?
=if(A0.10,(D-C)*100/C,0)

Im expecting a 0% difference between C AND D
IT SHOULD READ 0%
DOH! WHAT am i doing wrong here?
I GET A number anywhere from 0.03% to .09%
any tips to do this right?
  #2  
Old August 6th, 2008, 03:58 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default My rounding error in a simple IF

Not quite following you on this...

Does "=4.80" mean that's a calculated value?

If so, the 4.80 may not be the true value of that cell. It may be something
like 4.80000000056889

You should probably round it off to 2 decimal places.

--
Biff
Microsoft Excel MVP


"garron" wrote in message
...
col:A col:B col:C col col:E
4.82 -.02 =4.80 vs 4.80 =0%
why am i getting an error here?
=if(A0.10,(D-C)*100/C,0)

Im expecting a 0% difference between C AND D
IT SHOULD READ 0%
DOH! WHAT am i doing wrong here?
I GET A number anywhere from 0.03% to .09%
any tips to do this right?



  #3  
Old August 6th, 2008, 04:11 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default My rounding error in a simple IF

You should probably round it off to 2 decimal places.

Round it using the ROUND function. Don't just *format* it to show only 2
decimal places. Formatting is only for *display* purposes.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Not quite following you on this...

Does "=4.80" mean that's a calculated value?

If so, the 4.80 may not be the true value of that cell. It may be
something like 4.80000000056889

You should probably round it off to 2 decimal places.

--
Biff
Microsoft Excel MVP


"garron" wrote in message
...
col:A col:B col:C col col:E
4.82 -.02 =4.80 vs 4.80 =0%
why am i getting an error here?
=if(A0.10,(D-C)*100/C,0)

Im expecting a 0% difference between C AND D
IT SHOULD READ 0%
DOH! WHAT am i doing wrong here?
I GET A number anywhere from 0.03% to .09%
any tips to do this right?





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:29 AM.


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