I've been stuck on this for months--can anyone help?
We manipulate a lot of data that comes out of SAP/BW. The BW stuff is crazy with formatting--much of it specifically formatted as text (with a little ' mark in front of it.)
There is nothing I can do about this. It's something to do with how they do exports, and I think if I tried to explain the problem it would sound trivial but it's actually pretty disruptive for a dumb little problem.
The problem is when we try to do matching formulas with other, non-formatted spreadsheets that don't come from BW. It is very, very difficult to get a match on (let's say) serial number, when in one spreadsheet it's formatted as text and one is a number -- vlookups fail, and vlookups are our corporate currency.
Here are things that have been tried and failed, or work sometimes but not consistently:
1) copy and paste special
2) multiplying by 1 to force create an integer
3) =int(clean(trim(a1)))--and all variations thereof, e.g,
=trim(a1), =clean(a1), etc.
4) copy and pasting special to a new workbook
5) all manner of formating the columns to match data type--it "works", in that you don't get an error if you change the data type, but somewhere deep down, Excel persists in seeing an integer as text or vice versa.
This is the horror I resorted to last time: I copy pasted special to a new workbook, saved it as a .txt file, then opened in Excel, then changed the SN column data type to text in the import wizard(which was what my matching file was hoping for). That worked.
The issue is not always so hard to deal with -- sometimes a copy paste special to a new worksheet will drop the formatting (I just did this, and it even dropped the ' mark) but it's inconsistent.
We'd like to get more people to be self-sufficient with some simple Excel formulas but are having a hard time getting past these stupid formatting issues.
I know VBA well but haven't found anything within VBA that does anything beyond what the manual attempts above do. I'd be open to doing a 'clean the data' type macro, but don't know what I'd ask a macro to do that I haven't already tried manually.
Anyone have any suggestions?
Thanks
Rose
We manipulate a lot of data that comes out of SAP/BW. The BW stuff is crazy with formatting--much of it specifically formatted as text (with a little ' mark in front of it.)
There is nothing I can do about this. It's something to do with how they do exports, and I think if I tried to explain the problem it would sound trivial but it's actually pretty disruptive for a dumb little problem.
The problem is when we try to do matching formulas with other, non-formatted spreadsheets that don't come from BW. It is very, very difficult to get a match on (let's say) serial number, when in one spreadsheet it's formatted as text and one is a number -- vlookups fail, and vlookups are our corporate currency.
Here are things that have been tried and failed, or work sometimes but not consistently:
1) copy and paste special
2) multiplying by 1 to force create an integer
3) =int(clean(trim(a1)))--and all variations thereof, e.g,
=trim(a1), =clean(a1), etc.
4) copy and pasting special to a new workbook
5) all manner of formating the columns to match data type--it "works", in that you don't get an error if you change the data type, but somewhere deep down, Excel persists in seeing an integer as text or vice versa.
This is the horror I resorted to last time: I copy pasted special to a new workbook, saved it as a .txt file, then opened in Excel, then changed the SN column data type to text in the import wizard(which was what my matching file was hoping for). That worked.
The issue is not always so hard to deal with -- sometimes a copy paste special to a new worksheet will drop the formatting (I just did this, and it even dropped the ' mark) but it's inconsistent.
We'd like to get more people to be self-sufficient with some simple Excel formulas but are having a hard time getting past these stupid formatting issues.
I know VBA well but haven't found anything within VBA that does anything beyond what the manual attempts above do. I'd be open to doing a 'clean the data' type macro, but don't know what I'd ask a macro to do that I haven't already tried manually.
Anyone have any suggestions?
Thanks
Rose