Alternate need for vlookup

SeniorTom

Board Regular
Joined
Jun 5, 2017
Messages
96
The old Roster file had Column "B" = Lastname Column "C" = firstname.
GHIN #Last NameFirst Name
1910534SmithBob

<tbody>
</tbody>

The new file has Column "B" = lastname, firstname.
GHIN #Name
1910534Smith, Robert

<tbody>
</tbody>

We want to use the new format so we don't have to maintain two roster file and the new format is not flexable, ... so I need to be.

There are too many versions of "lastname, firstname" eg: Smith, Bob - Smith, Robert - Smith, Bobby, etc. So I asked for last name only

My old code to get their email address was:

Range(emailColumn & FirstRow & ":" & emailColumn & LastRow).Formula = "=VLOOKUP(B2,'" & RosterFileName & "'!roster,5,FALSE)"

I've looked at split and match but have not hit on a clean solution. Any thoughts would be appreciated.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
the issue with VLOOKUP is that SMITH will return the first SMITH, also is is reliant on sort order

INDEX MATCH would be a better choice, but I also think some Fuzzy logic might be needed and not sure how to implement that. You also seem to have a unique identifier so many work that in

your old data highligh duplicates on that and see what is a real issue
 
Upvote 0
Smith was a poor example, I have a work around for my 2 Smiths and 2 Dunns. The match returns the row number when used as a function on the spreadsheet, But I'm having some problems using it in VBA ... still at it

Thanks for your feedback
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,732
Members
449,093
Latest member
Mnur

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