zero balance


Posted by Kevin James on May 03, 2001 10:17 PM

Now here's a kick in the pants!
I maintain a personal sheet for tracking my daily miscellaneous spending. At the end of the day, I count money on hand and it should balance with what the sheet already determined.
It has worked up to today. I have determined there is something wrong with cell C11. When I Copy/Paste Special Values, the sheet corrects itself (cell E11).
I've tried increasing the number of deciimal places to see if somehow it has a stray number--all to no avail.

Download the file at:
(broken link)
See the Review tab.

Posted by Ian G on May 04, 2001 12:04 AM

Hi Kevin
Very weird. I have no idea why it's doing it, and you've probably thought of this already, but if you change your formula in E11 to =IF(G11=C11,"no diff",G11-C11) it appears to fix the problem and still gives you the info you need. I'll be keeping a close eye on this post to see why it's doing this though!
Cheers
Ian

Posted by Aladin Akyurek on May 04, 2001 12:15 AM

I see a very small number in E11, which is practically 0. The copy that I have shows a "General" cell format. I'd change to Number, say 2 decimals. Ian's suggested change to your IF formula in this cell a good one. I felt also compelled to rewrite it as follows:

=IF(G11-C11,G11-C11,"no diff")

Cheers.

Aladin

Posted by Aladin Akyurek on May 04, 2001 12:37 AM

Better...

Kevin,

The change to the IF-formula that I suggested doesn't make much sense.
I believe what follows is better:

=IF(ISNUMBER(G11),IF(ISNUMBER(C11),G11-C11,""),"")

Provided that you format E11 as Number.

Aladin

Posted by Dave Hawley on May 04, 2001 12:53 AM


Hi Kevin

I just took a quick look and nothing jumps out to point to any reason why this is happening. Try reproducing the problem on a New sheet. It is not unusual for a Worksheet to corrupt for no apparent reason.


Dave
OzGrid Business Applications

Posted by Kevin James on May 04, 2001 8:08 AM

Thanks to all of you. See notes.

Yes, this is a real brain cramp.

Dave: Thanks for idea of copying to another file, I'll try it.

Ian: I like the formula change. Heck, anything is worth a try.

Aladin: Very creative. I was going to try this in both C11 and G11: =INT([CurrentFormula]*100)*0.01 That would for sure compare apples to apples.

All: Have a wonderful life!

Kevin



Posted by Ivan Moala on May 04, 2001 8:01 PM

Re: Thanks to all of you. See notes.

Kevin
Here is some useful info that may enlighten you.
Floating-point mathematics is a complex topic.
Microsoft Excel was designed around the IEEE 754 specification
with respect to storing and calculating floating-point numbers.
IEEE is the Institute of Electrical and Electronics Engineers,
an international body that, among other things, determines standards
for computer software and hardware.
When storing numbers, a corresponding binary number can represent every number or
fractional number. For example, the fraction 1/10 can be represented in a
decimal number system as 0.1. However, the same number in binary format becomes
the repeating binary decimal

0001100110011100110011 (and so on)
Because there is no fractional part to an integer, its machine representation is much simpler than it is for floating-point values. Normal integers on personal computers (PCs) are 2 bytes (16 bits) long with the most significant bit indicating the sign. Long integers are 4 bytes long. Positive values are straightforward binary numbers. For example:

1 Decimal = 1 Binary
2 Decimal = 10 Binary
22 Decimal = 10110 Binary, etc.

However, there are some limitations of the IEEE 754 specification which fall into
three general categories:

- maximum/minimum limitations

- precision

- repeating binary numbers

Excel offers two basic methods to compensate for rounding errors: the ROUND
function and the "Precision as displayed" workbook option.

Method 1: The ROUND Function:

The following example using the data above, uses the ROUND function to force a
number to five digits. This allows you to successfully compare the result to
another value.

A1: 1.2E+200
B1: 1E+100
C1: =ROUND(A1+B1,5)

results in 1.00012

D1: =IF(C1=1.00012, TRUE, FALSE)

results in the value TRUE

Method 2: Precision as Displayed:

In some cases, you may be able to prevent rounding errors from affecting your
work by using the "Precision as displayed" option. This option forces the value
of each number in the worksheet to be the displayed value. To turn on this
option, click Options on the Tools menu. On the Calculation tab, click to select
the "Precision as displayed" check box.

For example, if you choose a number format showing two decimal places and then
turn on the "Precision as displayed" option, all accuracy beyond two decimals
will be lost when you save your workbook. This option affects the active
workbook including all worksheets. You cannot undo this option and recover the
lost data. It is recommended that you save your workbook prior to enabling this
option.

I'd personally use the Round function


Ivan