I have a problem with changing Cell Type from General to Number - excel

When I try to convert Large number (ex: 8996609817110286118) from General to Number, the result becomes: 8.99661E+18 ( 8996609817110280000), It forces this approximation, which I don't want)
Before Changing
After Changing to Number

There's no exact number representation in excel for numbers this big. You can either use strings instead of numbers (see this post), or live with the reduced accuracy. You did not specify what these numbers represent, but there are almost no applications that require physical quantities to be that accurate.

Related

Increase precision in Excel

I'm attempting to display exactly the first 100 powers of 2 (e.g. 1,2,4,8,16...) in a column in Excel. Unfortunately, once I get up to about 2 raised to the 50th, I'm hit by the Excel limitation of only working with 15 digits - hence, when Excel multiplies 2^49 * 2 I get the wrong answer:
562949953421312.00 * 2 != 1125899906842620.00
I have tried the Excel option "Set Precision as Displayed", but this doesn't seem to help. I suppose it makes sense that there needs to be an upper numeric limit somewhere, but it seems that there should be a way of multiplying large numeric strings, no?
562949953421312 * 2 == 1125899906842624
Excel cannot accurately represent numbers that do not fit into 64 bits. To represent numbers beyond 2^64 (you want to reach 2^100) would require more bits, therefore Excel will lose precision with such numbers.
This is an internal limitation of excel, and you should use a different tool to get exact results. Read the corresponding knowledge base article for more details - there is even a wikipedia page to describe the issues.
Try to wrap the number in the IFERROR function
=IFERROR("1201305162827683","1201305162827683")

Excel Weird Decimal Point Calculation

We have some weird calculation scenario in Microsoft excel, this simple addition operation resulting 1 at 13 decimal digit whereby it should be zero
But when i extract the value in formula the result is correct (both formula value is the same but the result is different)
From human understanding addition calculation will reduce the decimal digit rather than add it.
Is this by design or bugs ?
I strongly guess that this is a gap from the limited precision of floating point numbers. Accuracy of digital numbers is limited. Numbers in excel are saved in binary format(but displayed in decimal format). This means that the "0" is not as protected as in the decimal system. Usually Excel tries to cover this up for examples like yours.
Also, if your numbers derive from complex calculations (e.g. square-roots), the accuracy can be limited as most functions use approximation with limited iterations to give a result.
You can find more information about floating point arithmetic here. The blog is about pythin but the way it works is similar.
https://docs.python.org/3/tutorial/floatingpoint.html

Certain fractions being calculated in excel 2013

I'm creating a simple spreadsheet to calculate some betting odds and keeping track of my wins/losses
when I put fractional odds in one column Excel converts some of them to whole numbers (i.e. the ones that are 1/1, 2/1, etc where it does not do it for odds like 4/11, 7/2, etc.
Is there a way of turning this off?
Please note that some of the top heave fractions (11/2, 11/10 etc) get put into whole numbers such as 5 1/2 etc! And I do not want this to occur either
I've tried the Custom formatting of the cells but all of the denominators will inevitably be different, so having something like ??/28 won't work for me
EDIT:
This was solved using the custom format ??/?? and simply removeing the # that was at the front of the custom cell format dialog box
You simply need to change the cell format; you want to use ???/???. This will make Excel represent any decimal number to the closest fraction approximation it can find using the specified numerator and denominator significant digits (number of ? in the format string)
If the cell input is directly a fraction, it will reduce it if possible but always keeping the fraction format.
Examples:
= .10 will be converted to 1/10
= 0.1231 will be converted to 81/658 (supossing ???/??? format is used).
= 10/100 will be converted to 1/10
= 11/12 will remain as 11/12 as no reduction is possible.
= 1/1 will remain as 1/1
etc.
The behavior you are describing is becuase you are using one of Excel's default fraction formats which are all similar to # ???/??? (take note of the leading #). This format will reduce integral values to the non fractional part.
You could use text format for the cells with the odds, and then the VALUE function in any calculations you need to do with them

Excel if equal and match are not return the same thing

I have put two date time values in cells A1 and B1. The date time is precisely 41703.0416666667. One is ouput from an SQL database the other manually written.
The result of =if(A1=B1,1,0) is 1.
The result of =MATCH(B1,A1,0) is #N/A.
Does anyone have any theories as to why this may be happening?
Probably an issue with converting decimal to binary. See related answer:
Simple HLOOKUP Failing with Excel 2010
This appears to be a limitation of storing floating point numbers in binary - as described here: http://support.microsoft.com/kb/214118
Many combinations of arithmetic operations on floating-point numbers
in Microsoft Excel and Microsoft Works may produce results that appear
to be incorrect by very small amounts. For example, the equation
=1*(.5-.4-.1) may be evaluated to the quantity (-2.78E-17), or -0.0000000000000000278 instead of 0.
This problem is not unique to excel either but rather a result of:
IEEE 754 specifies that numbers be stored in binary format to reduce
storage requirements and allow the built-in binary arithmetic
instructions that are available on all microprocessors to process the
data in a relatively rapid fashion. However, some numbers that are
simple, nonrepeating decimal numbers are converted into repeating
binary numbers that cannot be stored with perfect accuracy.
The issue is with the floating-point calculation (see http://support.microsoft.com/kb/78113), one possible workaround is to work with the round() function. In your case, rounding to 10 or 12 decimals would probably be enough to address the issue.

Subtle difference in the results of these calculations: anyone know why (just out of interest)?

I was doing a "percentage change between two numbers" calculation, and I initially wrote it as (using Excel 2013):
=(NEW NUMBER - OLD NUMBER)/OLD NUMBER
I changed it to:
=NEW NUMBER/OLD NUMBER -1
.. to test to see if it was any faster with a large spreadsheet. Like I often do, I checked to see if the generated numbers were all equivalent (using a coerced CellColX = CellColY formula), and about 80% of them were, but others weren't -- by a tiny amount. I watched the action in the Evaluate Formula tool and expanded out the decimal places in the cells to where it was returning all 0's.
For instance, OLD NUMBER = 10.44 and NEW NUMBER = 10.86 resolves to 0.0402298850574713 using the first method, and 0.0402298850574712 using the second method.
However, OLD NUMBER = 13.17 and NEW NUMBER = 10.44 resolves to -0.207289293849658 using either method.
(The OLD and NEW numbers are genuine 2-place decimals.)
Mainly for OCD sake, is there a known reason for this? And is there any significance for very sensitive calculations?
is there a known reason for this?
As explained in Comments, Yes:
As with other spreadsheets, Microsoft Excel works only to limited accuracy because it retains only a certain number of figures to describe numbers (it has limited precision). Excel nominally works with 8-byte numbers by default, a modified 1985 version of the IEEE 754 specification[1] (Besides numbers, Excel uses a few other data types.[2]) Although Excel can display 30 decimal places, its precision for a specified number is confined to 15 significant figures, and calculations may have an accuracy that is even less due to three issues: round off,[3] truncation, and binary storage.
(From Wikipedia.)
is there any significance for very sensitive calculations?
Also Yes, and I suggest not just for very sensitive calculations, rather often where very large or very small numbers are involved in calculations. However because 'very large and 'very small' for normal scales are at the astronomical or anatomic level they are not very often encountered by Excel users. Though there are plenty of examples on SO, eg here and for Google Sheets.
Where these approximations cause problems on a regular basis is, as you have noted, in comparisons. Without rounding results that should be (mathematically) the same may not be and =EXACT or just = may return FALSE falsely.

Resources