Validate two words from cell using two other columns Microsoft Excel

dskribow

New Member
Joined
Nov 21, 2015
Messages
12
I've got what's probably a simple question concerning Microsoft Excel 2013 that I just can't figure out the answer to.
I have cell A1 that contains a name in the form of two words, such as "Jane Doe".
In two separate columns, I have separate lists of first and last names.
Here's what it looks like:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">
</code>
ABC
1Jane DooeyJaneDoe
2JaneDooey
3JohnDooey
4JohnDoe

<tbody>
</tbody>
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">
</code>
Here's what I'm trying to do: I'm trying to set up a validation rule in A1 that dissalows entering a two -word name that doesn't match a combination of columns B and C on some row.

How can I accomplish this?
Any and all help is much appreciated.
 
Last edited:

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try this...
=SUMPRODUCT(1*(($B$1:$B$4&" "&$C$1:$C$4)=A1))

Or this...
=MATCH(A1,INDEX($B$1:$B$4&" "&$C$1:$C$4,),0)
 
Last edited:
Upvote 0
Not saying anything is wrong with the previous suggestion but I think in Data Validation, you should only need:

=MATCH(A1,$B$1:$B$4&" "&$C$1:$C$4,0)
 
Upvote 0
AlphaFrog, this is amazing. Thanks. I'm using the second equation.

I don't really understand why this works, though, and why =MATCH(A1,$B$1:$B$4&" "&$C$1:$C$4,0) wouldn't/doesn't work as well.

Thanks, again.
 
Upvote 0
... why =MATCH(A1,$B$1:$B$4&" "&$C$1:$C$4,0) wouldn't/doesn't work as well.
This will not work directly as a cell formula, but it should work (does for me and AlphFrog) if used as a Data Validation (Custom) formula.
 
Upvote 0
Thanks for the prompt replies AlphaFrog.

The formula: =MATCH(A1,$B$1:$B$4&" "&$C$1:$C$4,0) doesn't work for me like yours. I get a #VALUE error.

Do you have an idea as to why this is?
 
Upvote 0
This will not work directly as a cell formula, but it should work (does for me and AlphFrog) if used as a Data Validation (Custom) formula.

Thanks for the explanation, Peter_SSs. This makes more sense now.

You guys are the best!
 
Upvote 0
The formula: =MATCH(A1,$B$1:$B$4&" "&$C$1:$C$4,0) doesn't work for me like yours. I get a #VALUE error.

Do you have an idea as to why this is?
In a cell, if you confirm its entry with Ctrl+Shift+Enter, not just enter then it should return a number, like AlphaFrog's formula (assuming the name is in the list).
data Validation automatically treats formulas as array formulas. That's the difference. :)
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,666
Members
448,977
Latest member
moonlight6

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