At work i use a lot of data that is from SAP. Unfortunately, there seems to be something wrong with the formating of the data. If i use isnumber on one of the cells containing a number, i get false.
This messes with my lookups and other formulae.
Is there a way i need to condition my data when it's coming from SAP?
Thanks
Last edited by thedon_1; 03-16-2011 at 06:32 AM.
You may want to post up a small sample workbook so we can see what you are up against...make sure it has some raw data straight from SAP so the formatting is the same as what you normally see and have to deal with.
Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
John Wright
I work with data from SAP HR. A lot of the the ID's and other fields whilst appearing to be numeric actually export to Excel as text. It's one of those things you just have to get used to I think.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Ok cool.
Here's 2 lists of data, there's a lookup formula in there demonstrating how wrong some of the results can be.
I tried using the trim function on the SAP data but it doesn't really help with.
Enter 1 in an empty cell - Copy - Select all your data - Right Click - Paste Special - Select Multiply - OK - Text is now nubers
To apply LOOKUP you will have to sort your data first
Quoting entire posts clutters the forum and makes threads hard to read !
If you are pleased with a member's answer then use the Star icon to rate it
Click here to see forum rules
I agree with Dom
This can sometimes help.
Select the Data to convert
Text to Columns > Delimited > Finish
This should convert text to numbers.
Then format the cells to suit the number of digits you need to display
e.g.
Format Cells.... Number > Custom
Type:= 00000000
Hope this helps
If you need any more information, please feel free to ask.
However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
Also
If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.
I have a macro like this in my Personal.xls to consistently convert lists to text value with a set number of leading zeros:
Sub Convert_Nums() Dim myRange As Range Dim strFormat As String Dim intFormat As Integer intFormat = InputBox("How many characters?") strFormat = WorksheetFunction.Rept("0", intFormat) Selection.NumberFormat = "@" For Each myRange In Selection If myRange <> "" Then myRange = Format(myRange.Value * 1, strFormat) End If Next myRange End Sub
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Perfect guys, works now, thanks so much for the help.
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
Quoting entire posts clutters the forum and makes threads hard to read !
If you are pleased with a member's answer then use the Star icon to rate it
Click here to see forum rules
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks