Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default precision question

I have a cell formula that works but the
cell displays it's output with 3 decimal pts
precision to the right. I desire only two
decimal pts to the right. How can I fix this?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default precision question

Two possible solutions... If it is just a display issue and you don't really
care how may decimals are being carried then you can right click on the
effected cell and change the formt to number and select the number of decimal
points to display.

The other solution is to use the round function. There is also a roundup,
rounddown and trunc function. To use round in this case you would do
something like...

=round(A1, 2)

Which yields 2 decimals of accuracy. You need to round when you are dealing
with money. For example...

$10.034 + 15.023 = 25.057 ...but changing the format it will look like
$10.03 + 15.02 = 25.06 which definitely looks wrong...

HTH

"D" wrote:

I have a cell formula that works but the
cell displays it's output with 3 decimal pts
precision to the right. I desire only two
decimal pts to the right. How can I fix this?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default precision question

If you're using VB coding then it would be:

ActiveWorkbook.Worksheets("Sheet1").Range _("A1").NumberFormat =
"$#,##0.00_);[Red]($#,##0.00)"

Where Sheet1 is your sheet, and subsitute A1 for your cells.
If you're not using VB then just, right click on the cell. Format Cell,
and use number, and then set the right precision.

NOTE: If you are using code, and don't want the $ sign, just remove them
it still works.

Darrin Henry

*** Sent via Developersdex http://www.developersdex.com ***
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
precision in solver Randi Excel Discussion (Misc queries) 4 April 13th 09 07:50 AM
Number precision Kenneth the polynomial man Excel Discussion (Misc queries) 2 October 4th 06 07:37 AM
Number precision Jake Excel Discussion (Misc queries) 2 May 5th 06 11:24 PM
Precision displayed does not match precision in cell James Wilkerson Excel Discussion (Misc queries) 10 June 15th 05 02:40 PM
precision calculation Renee[_3_] Excel Programming 0 January 14th 04 12:30 AM


All times are GMT +1. The time now is 09:05 PM.

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"