MISTAKE in calculations

SavaS

New Member
Joined
May 27, 2021
Messages
1
Office Version
  1. 2010
Platform
  1. Windows
At first sorry for my bad English. I'm not English speaker.
I do not understand why Excel show small amount in calculations instead zero.
For example:
Open new workbook, cells format as General, enter digits by keyboard (i mean formula use just in answer cell G1)

Cell A1 - enter 26.58
Cell B1 - enter 2.18
Cell C1 - empty cell
Cell D1 - enter 22.87
Cell E1 - enter 0.2
Cell F1 - enter 1.33
Cell G1 - formula =A1-B1-C1-D1-E1-F1
get an answer -2.44249E-15 WHY???? Why not zero?

I tried with another digits
Cell A1 - enter 30.61
Cell B1 - enter 2.44
Cell C1 - empty cell
Cell D1 - enter 24.64
Cell E1 - enter 0.1
Cell F1 - enter 3.43
Answer is correct. Get zero.

Could anyone explain this. THANK YOU!!!!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Welcome to the MrExcel forum!

The issue is how Excel stores floating point numbers. In short, Excel stores numbers in binary (a combination of 1s and 0s), and when you store numbers that way, they may not exactly equal the number in decimal. Here's an article that explains more:


One way around it is to use ROUND when doing comparisons. You can also use the Precision as Displayed option, although that has some issues too.
 
Upvote 0

Forum statistics

Threads
1,214,613
Messages
6,120,515
Members
448,968
Latest member
Ajax40

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top