Office & Productivity Software forum

General discussion

Displaying long numbers (greater than 15 char) in Excel

by MBAmonster42 / April 23, 2008 11:33 PM PDT

I work for a large processing house that produces thousands of reports every day that go out to many different users. Our standard for delivering reports is as CSV files to prevent the data from being truncated by Excel. While we send the files as CSVs, most of our end users open the files with Excel for easier viewing and data manipulation purposes.

A problem has arisen because our new transaction processing system uses a 32 bit numeric entry to uniquely identify the transaction. The field in CSV is properly filled in, but when the end users open up the CSV, the numbers are automatically translated into numeric, any digit beyond 15 is replaced by a "0", and then this modified number is translated into scientific notation. Now the data in the field is not only formatted in an illegible fashion, but the data itself has been converted wrong so even reformatting does not fix the problem.

Microsoft says that this is a feature of Excel is that numbers must conform to IEEE 757 standards of 15 characters or less, any digit beyond 15 is replaced by "0", and all other numbers must be treated as TEXT.

I need to find a way to change a setting in Excel, or the Excel registry so that numbers are automatically imported as strings of text instead of numbers. The solution must allow my end users to automatically open a CSV in Excel, and have the data display properly. I am aware that the users could manually import the information into Excel, but this is not something these people are going to be able to do on a regular basis.

Has anyone ever dealt with this before?


Thank you,

Post a reply
Discussion is locked
You are posting a reply to: Displaying long numbers (greater than 15 char) in Excel
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Displaying long numbers (greater than 15 char) in Excel
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Make them text.
by Kees Bakker / April 23, 2008 11:46 PM PDT

In other words, put quotes around them. Strings aren't converted or truncated, but stay as they are (at least up to 255 characters).

12345678901234567890123456789012 is truncated. "12345678901234567890123456789012" stays as it is, just like "1600 Pennsylvania Avenue, Washingon DC".

Any of your people importing any numbers they want to do calculations with, wouldn't really appreciate a global setting to treat all numbers as digits. While the above change only effects this one field is this one report.

Your statement 'The field in CSV is properly filled in" seems to contradict your other statement that "that numbers must conform to IEEE 757 standards of 15 characters or less". Using 32 digits is improper then.

Hope this helps.


Kees

Collapse -
Quotes as a solution
by MBAmonster42 / April 23, 2008 11:58 PM PDT
In reply to: Make them text.

The quotes do work (I tried that one already), but the end users are looking for "a better" solution. A single quote at the begining of the string of numbers "'" also works, but once again the end users have been complaining that they can not simply copy and paste the contents of the cell into a different application becaue of the additional quote(s).

Anyone have any other things I could try?

Collapse -
Sorry, wrong answer.
by Kees Bakker / April 24, 2008 12:12 AM PDT
In reply to: Quotes as a solution

I tested it myself now, and a 32-digit string is converted into a number like 1.23457E+17 automatically.

The workaround then (proven to work in Excel XP):
- rename the file to .txt
- in Excel, use File>Open to open it, this will call the text import wizard
- after answering a few questions about format (delimited) and separator (,) you'll reach the screen where you can specify the format for each column. If you specify text for the column with these long numbers they won't be converted and still look like a 32-digit number.

Kees

Collapse -
Avoiding the Import Wizard
by MBAmonster42 / April 24, 2008 12:25 AM PDT
In reply to: Sorry, wrong answer.

This works too.

Do you know if there is any way to get excel to automatically save these import settings so that the users do not have to go through all of these steps to open the report? What they want is to simply double click on the report that is emailed to them, and for it to open in excel with the numbers properly formated.

Does this make sence?

I am not trying to be a pain. I am simply trying to convey the complexity of what I am trying to do.

Collapse -
Would an Excel macro do it?
by MarkFlax Forum moderator / April 24, 2008 3:00 AM PDT

If you had an Excel Workbook where the first spreadsheet included a macro that automated these procedures, you could let each of those people have that workbook. It would then import the numbers and set them wherever else in the same workbook they are supposed to go.

Although I have some knowledge of Excel macro and VB code, my knowledge is limited and I do not know how to code it to open the txt file and import the numbers.

I'm sure it could be done though. A project for you or someone else?

Mark

Collapse -
Re: import settings
by Kees Bakker / April 24, 2008 4:22 AM PDT

To save import settings, you need MS Access. As far as I know Excel doesn't do it; that wouldn't be locigal indeed, because it's coming into a new workbook.

If you can format the number like, for example,
1234567890123456-7890123456789012, it's automatically recognized as text. Or any other format you like with at least one non-digit. But only digits is - by default - becoming a number.

The alternative would be to send it as, say, html or xml or pdf or rtf, so it opens in another application. In principle, it can be formatted nicely. Nothing in your posts until now shows the necessity for calculations to be done with the data.
Or make it available in any format you like via the company portal. That way, all necessary processing can be done automatically before any user sees it.

The basic problem, of course, is that Excel is originally a calculation oriented application. So it's understandable it does do something special with numbers that html or xml or pdf or rtf don't. Excel just isn't the 100% right tool to choose.

Kees

Collapse -
Great advice
by MBAmonster42 / April 24, 2008 9:06 PM PDT
In reply to: Re: import settings

I would prefer if our end users used anything other than Excel for these things, but Excel is all they know. I really like your idea of doing the formating my self and posting it on our internal portal. That will allow me to controll everything, and then the user still has the ease of just clicking on a link.

Thank you,

Collapse -
Or ...
by Kees Bakker / April 24, 2008 8:19 PM PDT

do some server-side processing and don't e-mail the .csv-file, but a nice .xls file, all formatted and ready to go. Easy to do, and I'm sure your company has either the necessary compentence in-house or the money to hire it.

Kees

Collapse -
Easy
by RaRdEvA / November 15, 2013 2:52 AM PST

Like the last post says, deliver an excel file instead of the CSV

Inside excel it can be done something so easy as this: Concatenate the number with "" (nothing) and it will convert it to string.

A
1- VeryLongNumber
2- 1.02E+15
3- 1.02E+15
4- 1.02E+15

B
1- Formula
2- =""&B3
3- =""&B4
4- =""&B5

C
1- Result
2- 1020000008630900
3- 1020000008625710
4- 1020000008625700

Popular Forums
icon
Computer Help 49,613 discussions
icon
Computer Newbies 10,349 discussions
icon
Laptops 19,436 discussions
icon
Security 30,426 discussions
icon
TVs & Home Theaters 20,308 discussions
icon
Windows 10 360 discussions
icon
Phones 15,802 discussions
icon
Windows 7 7,351 discussions
icon
Networking & Wireless 14,641 discussions

Tech explained

Do you know what an OLED TV is?

CNET explains how OLED technology differs from regular TVs, and what you need to know to make the right shopping decision.