Nested IF help please!

EmpireOfLight

New Member
Joined
Jun 10, 2017
Messages
3
Hi, I have a formula that checks to see if a value in one column exists in another column on a different sheet.
Code:
=IF(ISERROR(VLOOKUP(A2,stephanie!A:A, 1, FALSE)),FALSE,"stephanie" )

I want to check additional sheets (potentially many) such as sue, bob, mary, etc. if the value isn't found in stephanie, and continue through the entire list of names.

Right now the formula works, but only for one person.

Thanks for any help.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
What do you want the function to return if a name is found in more than one sheet?
 
Upvote 0
What do you want the function to return if a name is found in more than one sheet?

The names (bob, mary, etc) are just the names of the other sheets.
The values will be unique, and each sheet will have its own values. So mary might have 1,2,3,4 in the column I'm searching, and bob might have 5,6,7,8 in that column.

So to answer your question, it won't find a name, only numbers, and the numbers won't ever appear on more than one sheet.

Hope this makes sense.
 
Upvote 0
1 IF(ISERROR(VLOOKUP(A2,stephanie!A:A, 1, FALSE)),FALSE,"stephanie" )
2 IF(ISERROR(VLOOKUP(A2,sue!A:A, 1, FALSE)),FALSE,"sue" )
3 IF(ISERROR(VLOOKUP(A2,bob!A:A, 1, FALSE)),FALSE,"bob" )

Replace the second FALSE in eq. 1 with eq.2. So, you get:

IF(ISERROR(VLOOKUP(A2,stephanie!A:A, 1, FALSE)),IF(ISERROR(VLOOKUP(A2,sue!A:A, 1, FALSE)),FALSE,"sue" ),"stephanie" )

Then, replace the second FALSE in sue with eq. 3, and so on, and so forth.
 
Upvote 0
Might be simpler to do a COUNTIF() across the sheets, and return a value depending if the answer is 1 or 0?

1. create a list of all sheet names (you can add to this later if needed or also remove names.)
2. give that list a range name (I used Tabs)
3. Use this=SUMPRODUCT(COUNTIF(INDIRECT("'"&Tabs&"'!A2:A1000"),C2))

Also, if you have 2007 or later, yky's formula can be shortened to this...
=IFERROR(VLOOKUP(A2,stephanie!A:A, 1, FALSE),VLOOKUP(A2,sue!A:A, 1, FALSE))
or...
=IFERROR(VLOOKUP(A2,stephanie!A:A, 1, 0),iferror(VLOOKUP(A2,sue!A:A, 1, 0),VLOOKUP(A2,dan!A:A, 1, 0))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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