Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
is it possible to have excel use a formula such as look up to find a number range lets say 400-100 and match those numbers to a name?
for instance I have about 40 or more numbers in 4 cells that are merged the numbers are only separated by spaceshello hello hello, is there anybody in there...

Please make this run-on sentence a little clearer:
"for instance I have about 40 or more numbers in 4 cells that are merged the numbers are only separated by spaces"
Perhaps you could provide some examples of what you are trying to match up.

ok sorry for such a late reply I have been busing working on other things, ok in tab one I have a list, in this list cell A-F 4-7 are all merged together in this merged range of cells I have 73 numbers some are 4 digits and some are 3 digits. I then have another tab (tab 2) this tab has a list of names and there numbers i.e.
cell A1 = John and B1 = 372
can I use a formula to take the numbers in tab 1 cells a-4/a-7 and compare them to tab 2's a1 and b1 and formulate a list of names and numbers.hello hello hello, is there anybody in there...

First - Feel free to throw a period into your posts every now and then. That might make them a little easier to understand.
Next - you wrote "in this list cell A-F 4-7 are all merged together in this merged range of cells I have 73 numbers some are 4 digits and some are 3 digits."
In this pile of words, I think you are referring to range A4:F7, correct?
If that is correct, and that range is indeed merged, then I don't see how you could have 73 numbers in that range. If you merge a range of cells, it essentially becomes 1 cell that can only contain 1 value.
If those cells aren't really merged, then that range only contains 24 cells, so I still don't see how you have 73 numbers in that range.

I understand that your crammer is much better then mine I apologize for not being as smart. I always figured a run on sentence and a correctly punctuated sentence are both still sentence's and that's fine by me, not here is a link to an example image
http://i396.photobucket.com/albums/...hello hello hello, is there anybody in there...

I'm trying to help you with your Excel issue, so please allow me to help you with your grammer also.
The only reason I brought up your lack of punctuation is that it makes it really hard to figure out what you are asking. If your questions are easier to understand, then it is easier for us to help you - which is why we are here.
Read your sentences back to yourself and if you think you should be pausing between 2 thoughts, simply put a period there. Shorter sentences, with only one fact per sentence, would be easier to understand.
Now, for your Excel question...
If all of those numbers are in one cell, you have some choices:
1 - Parse them out by using the Data...Text To Columns feature after either unmerging the cell or copying the data to a single unmerged cell.
Once each number is in it's own cell, you can use VLOOKUP to match the numbers from one tab to the other. I can't be sure just by looking at your picture, but it's possible that there are carriage returns (Alt-Enter) in the cell and that may cause a problem with the Text to Columns results.
2 - Use a bunch of fairly complicated MID() formulae to grab each individual number by determining where the spaces are as well as the length of each individual string. If all the numbers were 3 digits, things would be alot easier, but since you have some 4 digits numbers also, things get complicated.
As an example, the first formula below will grab the first set of digits. That's pretty easy. After that, things get complicated. The second formula will grab the 2nd set of digits. Both formulae are written as if we don't know how many digits are in any given set.
(These formulae assume the group of numbers is in A4)
=LEFT(A4,FIND(" ",A4)-1)Result should be 400
=MID(A4,FIND(" ",A4)+1,(FIND(" ",A4,FIND(" ",A4)+1)-FIND(" ",A4)-1))
Result should be 401
After that it gets even more complicated as you have to keep figuring out where to find the next spaces so you can start the MID at the correct character and stop it at the next space.
3 - Use VBA to parse the numbers into individual cells and then use a VLOOKUP function on the individual numbers.
This code will parse the values in A4 and put them in Column G. It looks for both a "space" between each set of digits and also for a "carriage return" (CHR(10)) between lines in case Alt-Enter was used to separate the lines. Since I am only looking at a picture of your spreadsheet, I obviously can't test the code against your data. I suggest that you back up your spreadsheet before trying this code in case things go terribly wrong.
Sub Parser()
Range("G:G").ClearContents
rCell = 1
For c = 1 To Len(Sheets(1).Range("A1"))
If Mid(Sheets(1).Range("A1"), c, 1) = " " Or _
Mid(Sheets(1).Range("A1"), c, 1) = Chr(10) Then
c = c + 1
rCell = rCell + 1
End If
Range("G" & rCell) = Range("G" & rCell) & Mid(Sheets(1).Range("A1"), c, 1)
Next
End Sub

Thank you so much, also I apologize again for my grammar issues, I hope the picture helped. I will work on making my sentences and questions easier to understand, because I love these forums you have all helped me with all the questions I have ever asked. I will try this out and I'll let you know how it worked. I know its frustrating sometimes the way I word my questions (my mind is jumbled all the time and it shows in my writing.) Thank you again and have a great day.
hello hello hello, is there anybody in there...

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |