Question regarding if statement for matches

marcdenney1

New Member
Joined
Sep 24, 2014
Messages
42
Hi,
I would like a formula to perform a match dependent on the value in the cell.

for example:

if A1 contains "123" match against range A:A in sheet 2
if A1 contains "456" match against range A:A in sheet 3
if A1 contains "789" match against range A:A in sheet 4

i would also like to to return some text depending on the result of the match, which would be different fopr each condition above

e.g. if A1 contains "123" match against range A:A in sheet 2 does not return a match i would like the text"add to sheet2"

is there any easy way to do this?

Thanks

Marc
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Try this replacing the numbers with what you are after. Find is case sensitive so be aware. Can use search instead of find if you don't want this

=IF(COUNT(FIND({"1","2","3"},A1)),IFERROR(MATCH(E1,Sheet2!A:A,0),"Add to Sheet2"),IF(COUNT(FIND({"4","5","6"},A1)),IFERROR(MATCH(E1,Sheet3!A:A,0),"Add to Sheet3"),IF(COUNT(FIND({"7","8","9"},A1)),IFERROR(MATCH(E1,Sheet4!A:A,0),"Add to Sheet4"),"No Match")))
 
Upvote 0
Try this replacing the numbers with what you are after. Find is case sensitive so be aware. Can use search instead of find if you don't want this

=IF(COUNT(FIND({"1","2","3"},A1)),IFERROR(MATCH(E1,Sheet2!A:A,0),"Add to Sheet2"),IF(COUNT(FIND({"4","5","6"},A1)),IFERROR(MATCH(E1,Sheet3!A:A,0),"Add to Sheet3"),IF(COUNT(FIND({"7","8","9"},A1)),IFERROR(MATCH(E1,Sheet4!A:A,0),"Add to Sheet4"),"No Match")))

That's perfect, thanks so much for your help
 
Upvote 0

Forum statistics

Threads
1,216,031
Messages
6,128,424
Members
449,450
Latest member
gunars

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