nested VLookups with IFERROR

Kmitchell

Active Member
Joined
Feb 27, 2007
Messages
361
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

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.
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,215,883
Messages
6,127,541
Members
449,385
Latest member
KMGLarson

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