What did I do wrong?

mcintoshmc

Active Member
Joined
Aug 10, 2007
Messages
277
This formula returns "N/A", and for this particular row, it should return "Pending" because the identifier is in the pending hires and transfers page.

=IF(VLOOKUP(A2,'Open Reqs'!A:A,1,FALSE),"ACTIVE",IF(VLOOKUP(A2,'Pending Hires & Transfers'!A:A,1,FALSE),"PENDING",IF(VLOOKUP(A2,Archived!A:A,1,FALSE),"FILLED","CANCELLED")))
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I tried this, and all the actives worked, but nothing else.

=IF(VLOOKUP(A2,'Open Reqs'!A:A,1,FALSE)=$A2,"ACTIVE",IF(VLOOKUP(A2,'Pending Hires & Transfers'!A:A,1,FALSE)=$A2,"PENDING",IF(VLOOKUP(A2,Archived!A:A,1,FALSE)=$A2,"FILLED","CANCELLED")))
 
Upvote 0
If it does not find the value, then it returns error #N/A and it does not continue with the next search.
That's why I use IFERROR(if it does not exist, it returns false)

Try this:

=IF(IFERROR(MATCH(A2,'Open Reqs'!A:A,0),FALSE),"ACTIVE",IF(IFERROR(MATCH(A2,'Pending Hires & Transfers'!A:A,0),FALSE),"PENDING",IF(IFERROR(MATCH(A2,Archived!A:A,0),FALSE),"FILLED","CANCELLED")))
 
Upvote 0
First, =IF(VLOOKUP(A2,'Open Reqs'!A:A,1,FALSE),... and =IF(VLOOKUP(A2,'Open Reqs'!A:A,1,FALSE)=A2,... do not make sense.

If the value in A2 is not in the range 'Open Reqs'!A:A, the function returns #N/A, so the formula does indeed return #N/A.

You do not even get to the "Pending" and "Filled" tests.

I think you want the following:

=IF(ISNUMBER(MATCH(A2,'Open Reqs'!A:A,0)),"ACTIVE",
IF(ISNUMBER(MATCH(A2,'Pending Hires & Transfers'!A:A,0)),"PENDING",
IF(ISNUMBER(MATCH(A2,Archived!A:A,0)),"FILLED","CANCELLED")))

Unrelated observation.... Instead of A:A, I would use $A$1:$A$1000 or whatever range is sufficient, while reasonably large enough to accommodate additions. I don't know if MATCH is smart enough to avoid searching all 1+ million rows.
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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