nested if statement problem

monsierexcel

New Member
Joined
Nov 19, 2018
Messages
29
Hello all, i cant find why this doesnt work

=IF(VLOOKUP(C2,'cost prices'!$B:$J,9,0),VLOOKUP(C2,'cost prices'!$B:$J,9,0),IF(VLOOKUP(C2,'cost prices'!$B:$I,8,0),VLOOKUP(C2,'cost prices'!$B:$I,8,0),IF(VLOOKUP(C2,'cost prices'!$B:$H,7,0),VLOOKUP(C2,'cost prices'!$B:$H,7,0),IF(VLOOKUP(C2,'Kit Products Cost Prices'!$B:$J,9,0),VLOOKUP(C2,'Kit Products Cost Prices'!$B:$J,9,0),IF(VLOOKUP(C2,'Kit Products Cost Prices'!$B:$I,8,0),VLOOKUP(C2,'Kit Products Cost Prices'!$B:$I,8,0),IF(VLOOKUP(C2,'Kit Products Cost Prices'!$B:$H,7,0),VLOOKUP(C2,'Kit Products Cost Prices'!$B:$H,7,0),VLOOKUP(C2,'Kit Pricing not in AP'!$A:$B,2,0)))))))

when i look at function arguments for the line:

IF(VLOOKUP(C2,'Kit Products Cost Prices'!$B:$H,7,0),VLOOKUP(C2,'Kit Products Cost Prices'!$B:$H,7,0),VLOOKUP(C2,'Kit Pricing not in AP'!$A:$B,2,0)

which shows its finding the correct value yet it still showing an NA error on return :( i cant figure this when the condition is showing the right value at 154.08!

I know you can have upto 7 nested IF statements but i only have 6 here.

thank you,
 
If you are running a recent version of Excel function ISNA is available instead of ISERROR (use exactly the same syntax)

thanks for the feedback
(y)
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Heres a way to do that:

=IFERROR(LOOKUP(2,1/(INDEX('cost prices'!H:J,MATCH(C2,'cost prices'!B:B,0),0)<>""),INDEX('cost prices'!H:J,MATCH(C2,'cost prices'!B:B,0),0)),IFERROR(LOOKUP(2,1/(INDEX('Kit Products Cost Prices'!H:J,MATCH(C2,'Kit Products Cost Prices'!B:B,0),0)<>""),INDEX('Kit Products Cost Prices'!H:J,MATCH(C2,'Kit Products Cost Prices'!B:B,0),0)),IFERROR(IF(VLOOKUP(C2,'Kit Pricing not in AP'!$A:$B,2,0)="","error",VLOOKUP(C2,'Kit Pricing not in AP'!$A:$B,2,0)),"error")))
 
Upvote 0

Forum statistics

Threads
1,215,477
Messages
6,125,036
Members
449,205
Latest member
Eggy66

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