nested VLookups with IFERROR

Kmitchell

Active Member
Joined
Feb 27, 2007
Messages
363
Office Version
  1. 365
Platform
  1. Windows
Hello -

Any guidance on the below formula? There are two IFERROR lookups but I it is not working or changes the comma before the second IFERROR to a * and that does not give expected results. TIA!

=IF($N2="NS",$K2,IF(AND($N2="SB",$Q2="Y"),IFERROR(VLOOKUP($T2,'PCP Contractual FS'!$Q:$S,2,0),VLOOKUP($U2,'PCP Contractual FS'!$Q:$S,2,0)))),(IF(AND($N2="SB",$Q2="N"),IFERROR(VLOOKUP($T2,'SPEC Contractual FS '!$N:$P,2,0),VLOOKUP(U2,'SPEC Contractual FS '!$N:$P,2,0))))
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
NOTE: You have a space after references to "SPEC Contracutual FS" but not after "PCP Contractual FS"
Even if that's correct it's inconsistant with your sheet naming convention.

Shouldnt it be this?

=IF($N2="NS",$K2,IF(AND($N2="SB",$Q2="Y"),IFERROR(VLOOKUP($T2,'PCP Contractual FS'!$Q:$S,2,0),VLOOKUP($U2,'PCP Contractual FS'!$Q:$S,2,0)),IFERROR(VLOOKUP($T2,'SPEC Contractual FS'!$N:$P,2,0),VLOOKUP(U2,'SPEC Contractual FS'!$N:$P,2,0))))
 
Last edited:
Upvote 0
Thank you for your reply but I need to keep the two if(AND statements, I think your suggestion eliminated the one with the "N"

IF(AND($N2="SB",$Q2="Y")
IF(AND($N2="SB",$Q2="N")
 
Upvote 0
I assumed I could leave out the other AND()

Perhaps

=IF($N2="NS",$K2,IF(AND($N2="SB",$Q2="Y"),IFERROR(VLOOKUP($T2,'PCP Contractual FS'!$Q:$S,2,0),VLOOKUP($U2,'PCP Contractual FS'!$Q:$S,2,0)),IF(AND($N2="SB",$Q2="N"),IFERROR(VLOOKUP($T2,'SPEC Contractual FS'!$N:$P,2,0),VLOOKUP(U2,'SPEC Contractual FS'!$N:$P,2,0)),"")))
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,224
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