# Having a problem matching columns

#### RVD1234

##### New Member
I used a few split text functions, (aka: right, left, find) and split the text into what I finally wanted. Now I want the new column of text to equal another column and only some of the text is matching up. For example, it kind of looks like this:

First Column Split Column Abbr Abbr Match Result
singled to shortstop (2-2) singled to shortstop S6 singled to shortstop S6
flied out to cf (1-0) flied out to cf FO8 flied out to cf blank

So basically, whenever the split column equals the abbr match column, I want the result column to equal the abbr column. My issue is that sometimes it works and sometimes it doesn't and there doesn't seem to be a distinction as to why. I've seen if one cell equals another one, and the same thing happens, sometimes they're equal, sometimes they're not. I hope you can help and if I wasn't clear, I can try to explain another way. Thanks!

[/IMG]

#### RVD1234

##### New Member
Because my original post didn't lay out like I wanted it to, this is what I'm working with. For example, A29 should equal C5. If it did, it would put B29 into D5. However, since Excel does not recognize that A29=C5, it doesn't work. However, it sees that C19 is equal to A10 so B10=D19.

#### mrerer

##### New Member
Not quite enough here to be sure, but...
Is there a VLookup in Column D to return your match code? If so, some results are not returning due to not being exact matches; try using the trim function to match lookup words by eliminated spaces, blanks, etc:
=VLOOKUP(TRIM(C2),\$A\$1:\$B\$100,2,FALSE)

#### RVD1234

##### New Member
So I used a VLookup in Column D (=IFERROR(VLOOKUP(C2,A:B, 2, 0), "")). I used the Trim (actually, I just put the trim into my original equation (=IFERROR(VLOOKUP(TRIM(C5),A:B, 2, 0), "")) and it gave me the values that I was missing but took away everything else I had before. So if there's a way to put the two together, we're in business

#### mrerer

##### New Member
Yeah, you could literally combine them:
=IFERROR(VLOOKUP(C2,A:B,2,0),IFERROR(VLOOKUP(TRIM(C5),A:B, 2, 0), ""))

Also, sounds like you could Trim your Column A, then base the Lookup off that.

1,082,250
Messages
5,364,022
Members
400,774
Latest member
Goldi paul

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...