Multiple IF VLOOKUP formala

agriswold

New Member
Joined
Jul 27, 2018
Messages
5
Hello -
I have two lists on two separate worksheets in a workbook. In a third worksheet in column A, I need to check if the values in a list match either of the values in the lists on other two tabs. If the value is found in the first worksheet, I want to return "1" and if the value is found in the 2nd worksheet I want to return "2". If it's not found anywhere, I need to return "3". I am trying to make a formula with multiple IF(VLOOKUP) functions work, but not having success.

Here is what I am trying:
=IF(VLOOKUP(A1,'Worksheet1'!A:A,1,FALSE),"1",IF(VLOOKUP(A1,'Worksheet2'!A:A,1,FALSE),"2","3"))
I am getting a #VALUE error for values that are in either Worksheet 1 or 2, and an #N/A error for values that are not in either worksheet.

Any suggestions?

Thanks in advance!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Its because the IF requires a true or false result from the logical test. The VLOOKUP will be producing whatever is in A1 so not a true or false result. Try this:

=IF(ISNUMBER(MATCH(A1,Worksheet1!A:A,0)),1,IF(ISNUMBER(MATCH(A1,Worksheet2!A:A,0)),2,3))
 
Upvote 0

Forum statistics

Threads
1,203,082
Messages
6,053,420
Members
444,662
Latest member
AaronPMH

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