Strange Value Results in a Cell

Written by Allen Wyatt (last updated August 17, 2019)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


3

Lynn uses Excel to keep track of her checkbook. She has the cells in the worksheet formatted to show values like $1,234.56. Sometimes, but not always, if Lynn changes the formatting of a cell it may look like 1234.56000000001. This seems like an error to her and she finds it annoying, so she is wondering why the figures look this way at times.

Lynn has inadvertently discovered the strange, wonderful world of Excel math. You see, when you do math in an Excel formula, because of the way that Excel does the calculations internally, you could easily end up with a rounding error at the most extreme ends of the calculation. (Excel maintains internal precision to 15 significant digits, which is why Lynn is seeing the "error" out at the very furthest reaches of her number.)

In routine calculations—like the ones being done by Lynn—this typically isn't a problem. In her usage, she only cares about numbers being correct to a precision of two decimal places. When the "error" is in the eleventh decimal place, it isn't going to affect the validity of what Lynn sees. It would only affect the results if a particular result relied upon thousands and thousands and thousands of previous calculations. This is the only way that the "error" could compound to the point where it affects Lynn's results.

In day to day usage, this shouldn't be an issue. The "error" is hidden easily by using a cell format such as Currency or Accounting that displays values, so they show only two decimal places.

If the rounding issues bug you a lot, the easiest solution is to force your formulas to round to the number of decimal places you want. For instance, let's say you have a very simple formula such as the following:

=A1-B1

You could "wrap" the formula in the ROUND function, in this manner:

=ROUND(A1-B1,2)

This forces the result returned by Excel to two decimal places, which is what Lynn would expect to see if she removes the cell formatting.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13663) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Moving Cells Using the Mouse

Want to easily move information from one cell to another? A quick way to do it is to simply drag and drop using the mouse.

Discover More

Using a Formula to Replace Spaces with Dashes

If you need a formula to change spaces to some other character, the SUBSTITUTE function fits the bill. Here's how to use it.

Discover More

Converting Tables to Text

Need to convert all the tables in your document into plain text? This tip provides a macro that can make quick work of a ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Shortening ZIP Codes

US ZIP Codes can be of two varieties: five-digits or nine-digits. Here's how to convert longer ZIP Codes to the shorter ...

Discover More

Tracking Down Invalid References

When you discover that there is an invalid reference in a workbook, you can have a bear of a time tracking down the ...

Discover More

Identifying Values that Don't Follow a Specific Pattern

When you store textual information in a worksheet, it can be helpful to figure out if that information follows a pattern ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

2019-08-17 21:34:27

MW

RH: Great tip!!

However when I applied it (unless I did something wrong) I immediately realized your instructions only reset this setting on the current Workbook you are working in; it is not a universal change.

In order to affect all of a user's new Excel files by default they must locate and make your recommended setting change in all of their template files (i.e. where they want this change to occur) and save them as their default template.

And as anybody unfamiliar with template files will find out, making a universal change in the default template file(s) can be a challenge.

So one should first search Allen's Excel Tips website for Template Changing instructions.


2019-08-17 08:54:17

Lynn Gates

Thanks for the rounding tip...I had stumble on the solution after I sent the email for help. I do appreciate you looking into it.

lg

PS 72+ years ago when I was born, my parents named me Lynn...a name that is shared with many females...however I was born a male and have been all my life. Interestingly enough in my high school class there was another male named Linn. Granted not a common name...but nicer than what I was called by some people I arrested while being a policeman.

lg


2019-08-17 05:20:22

RON HOWELL

Another fix is to click on the File tab, go down the left side menu and select options.
Select the Advanced option, scroll down to almost the bottom of the window and check "Set Precision As Displayed".
Click the ok button on the popup screen that states "Data will permanently lose accuracy". This will not adversely affect your calculations when you are only going out to less than 10 decimal points and as an added bonus it will eliminate the annoying negative zero.
The other benefit is that you will not have to use the round formula for each cell, it will automatically adjust all cells.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.