Excel is scrambling data!!

schatham

New Member
Joined
May 28, 2003
Messages
42
We have an application that takes data from an enterprise system & will extract data into a flat, CSV file. We have a product that functions with excel in which you can generate all sorts of excel reports (it uses add-ins to do this stuff). In the middle, we've got SQL 2008, which uses these flat, CSV files, and creates data cubes in SQL, and then pushes out specific files to Excel.

That said, recently, I took one of these CSV files & pulled it into Excel to filter the data & see what may have been causing an issue downstream. I filtered it, then saved it to a CSV file & then ran it thru the product.

The bad news is, that in some of the number fields, Excel scrambled the data in there.

The field in question is a UPC Code field, that in our case, can be 18 characters long.

What Excel did in my case was to do one of three things:
1. It left the UPC code field alone,
2. It gave the UPC Code field a Scientific notation (1.109843E+17), or
3. it simply "rounded" the right most 3 digits (best I can tell) of that field.

I lost 1/2 the day last Friday chasing those 3 digits on a few thousand UPC codes where excel simply "rounded" out any distinction between them.

This same issue has hit at least two other people this week.

Is there any setting, code or anything else to allow Excel to open, filter (or anything) and re-save this data without it changing it?

Not sure if this needs to be in another forum or not, but thought that it may be applicable to programming if there was code needed to change it on open.

Any help appreciated.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
If you have numbers with more than 15 digits, Excel will simply convert the remaining digits to 0. You need to format the column as text prior to adding data to it, or, if importing into Excel, specify that the field is Text not numeric.
 
Upvote 0
Thanks, Rory - I will give that a try.

These files are CSV files. Does Excel still do this if you choose to Import the data, or does it only do it if you double-click on the file name to open it?
 
Upvote 0
If you import the data, you shoudl be able to specify that the field is text, not numeric in the import wizard.
 
Upvote 0

Forum statistics

Threads
1,214,621
Messages
6,120,568
Members
448,972
Latest member
Shantanu2024

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