Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 11-04-2017, 11:12 AM
joeu2004 joeu2004 is offline Entering a number of 19 digits Windows 7 32bit Entering a number of 19 digits Office 2007
Advanced Beginner
 
Join Date: Aug 2016
Posts: 32
joeu2004 is on a distinguished road
Default

Quote:
Originally Posted by ArviLaanemets View Post
there is a workaround for 15-number limit. [....] 1. Divide the number to 2 parts [....] P.e. to make calculations with integers like 123456789012345678 enter it as 123456789 and 12345678
Not sure what you have in mind, because you neglected to show a complete example of how you would combine them later in a calculation, if that is your intent.

(Not sure that is Jo's intent, anyway.)

There is no getting around the fact that Excel stores numeric values as 64-bit binary floating-point, and the precision is limited to 53 consecutive powers of 2 ("bits") times a binary exponential factor.

That limits any and all attempts to combine your terms into an accurate integer to any integer that is 2^53 or less, and to only some integers greater than 2^53.

In your example of representing 123456789012345678 with integers 1234567890 (corrected) in A1 and 12345678 in A2, the numeric value must eventually become 123456789012345678, which we might write =A1*1E8+A2. The exact decimal presentation of the resulting binary value is 123456789012345680.

(In the old days, we would write multiprecision algorithms that used integer parts that were limited to 16 bits. Much easier to do in assembly language, IMHO. But I dare say the mathematics are beyond the ability of most programmers today, not to mention the casual user.)

That is better than 123456789012345000 (actually 123456789012344992 after binary conversion), which we get if we enter it manually. But it is still not 123456789012345678.

(PS.... The close similarity of 123456789012345680 is coincidence. Here's another example: 6118447641 and 26275648 combine to be 611844764126275648. The exact decimal presentation of the binary value is 611844764126275584.)

And equally important: Excel will display the numeric value as 123456789012346000, which I suspect Jo would dislike.

I think this is a distraction. Jo seems content with entering the large "number" as text. She just wanted to know how. I was merely noting that your suggest to enter the number first, change the cell format to Text, then press f2 Enter would not work because the excess precision is already lost.

Jo hit upon the correct solution herself: set the cell format to Text first.

Quote:
Originally Posted by ArviLaanemets View Post
2. Design formulas (or user-defined functions) for mathematical operations with such number pairs
No need to split "numbers". Just enter the complete number as text. If we can bother to write 1234567890 and 12345678 into separate cells, we could simply write '123456789012345678 (note the leading apostrophe) or ="123456789012345678", if not set the cell format to Text.

There are VBA data types that work with more precision, notably type Decimal and the CDec function. But the result will be converted to 64-bit binary floating-point if it is stored as a number in Excel. To preserve the precision, we must store the result as text.

No need to reinvent the wheel. There are add-ons that provide a library of functions that do just that.

But the point is: the result is text. And again, any attempt to convert the text to a numeric value in Excel will be faced with the 64-bit binary floating-point limits noted above and in my previous posting.

Last edited by joeu2004; 11-05-2017 at 07:56 AM. Reason: PS
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having number's digits together mohsen.amiri Word 0 06-23-2017 01:20 AM
Entering a number of 19 digits Digits are not found in my document! reza8615953 Word 3 04-18-2017 10:48 AM
Entering a number of 19 digits Entering a number in a cell causes it to fill with the color of a nearby cell Bill Martz Excel 1 04-23-2015 07:57 PM
Separate the digits into 3 combinations Jasa P Word VBA 1 08-19-2012 11:04 PM
Entering a number of 19 digits Problems merging in last 4 digits of an account higher than 16 digits Glynda Mail Merge 1 04-08-2011 12:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft