First & Last Name in a Single Cell Comparison Checker

censo

Board Regular
Joined
Dec 25, 2015
Messages
161
Office Version
  1. 2013
Platform
  1. Windows
Greetings,

I have two columns (A:B) with First and Last names present in each column and I'd like to construct a function in column C that compares the entire cell contents from B:A and only indicates when it cannot discern a match for a given row.

Additional Details

- I do not require the names be parsed out into their own columns.
- If either the first or last name is detected, the result is considered a match
- If neither first or last name is detected, the result is considered a mismatch and outputs an "N"
- Middle names or initials are sometimes present. Middle names can be evaluated but initials should be ignored (so, any characters >1)
- The key cell is B, to which A will be compared for determining a mismatch (B-->A)

Basically, if any component of a name can be detected (except a single character Middle Initial), it is considered a match and does nothing (blank value)

Diagram below shows intended output

If the below is not possible, I'd entertain the next best solution that gets me close.

Thanks in advance.

- C

Book1
ABC
1Name AName BMatch?
2Sara LeeSara Lee
3S LeeSara Lee
4Sara M LeeS M Lee
5Sara LS LeeN
Sheet1
 
Well, I took you literally when you stated you wanted to "construct a function". The code provided does just that, and does not need to be modified to accommodate your real-world environment.
Ahh, thanks for the clarification. What I really wanted was a formula but I always thought that by definition a formula that did not calculate numbers is called a function.

With that I thank you again for your engagement. I have chosen Phuoc's solution to implement into my environment.

Happy New Year
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,215,018
Messages
6,122,703
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