Finding a value by searching multiple columns

Texas Longhorn

Active Member
Joined
Sep 30, 2003
Messages
493
This should be easy, but even after searching the board, I can't figure it out. I someone could offer the solution or post a link to it, that would be great. Here's what I've got: In Sheet1, I have one column of user id's column A, A1:A200. On Sheet2, I have three columns, Director, Manager, and Rep (A1:A100, B1:B100, and C1:C100, respectively). In column B on Sheet1, I want to lookup the value in column A and see if it is in column A, B, or C on Sheet2.

I don't need the formula to tell me which of the 3 columns it exists in (though that would also be cool). I just need to know if it's in any of the three columns, yes or no.

Many thanks!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Probably not the most efficient method, but for those interested:

In Sheet2, I concatenated A, B, and C in column D via =a1&b1&c1. Then, in column B of Sheet1 I entered this formula:

=VLOOKUP("*"&A2&"*",Sheet2!$D$2:$D$100,1,FALSE)

It worked well enough for my purposes.

Thanks,

Bill
 
Upvote 0
This should also work:

=COUNTIF(Sheet2!A1:C100,A1)

Will be 0 if no match, and > 0 if there is a match. Or, if you want TRUE/FALSE, you could try:

=COUNTIF(Sheet2!A1:C100,A1)>0

Hope this helps,

Russell
 
Upvote 0
Thanks to you both. Aladin, my data is all text. Does this affect your solution? I'm returning all zeros. I know I've read on here about the "--", but I need to check again on what it does.

Thanks
 
Upvote 0
Texas Longhorn said:
Thanks to you both. Aladin, my data is all text. Does this affect your solution? I'm returning all zeros. I know I've read on here about the "--", but I need to check again on what it does.

Thanks

MATCH can take most values (logicals,numbers,dates,times, and text) as lookup values. Incidentally, my exhibit consists of text values.
 
Upvote 0

Forum statistics

Threads
1,215,129
Messages
6,123,218
Members
449,091
Latest member
jeremy_bp001

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