if statement with vlookup - returning false

jgold20

Board Regular
Joined
Feb 4, 2018
Messages
135
I have 3 different conditions and I am trying to use vlookup. Only the 1st if(and statement works. The 2nd and 3rd if(and return FALSE from the vlookup (***note each if(and statement works by its self***). Can I use if(and vlookup with the statements below?. The 2nd set of code works

=IF(OR(A9=""),"",
IF(AND($D$3="yes"),IF(OR($A$3={"D","DT","V","X"}),(J9*5%+125)),
IF(AND($D$3="yes"),IF(OR($A$3={"GE","SR","VP"}),VLOOKUP($A$3,'Company Info'!$A$1:$L$25,8,FALSE)*D9),
IF(AND($D$3="yes"),IF(AND(D9<3333.34),VLOOKUP($A$3,'Company Info'!$A$1:$L$25,8,FALSE)*D9,200),0))))


WORKS
=IF(OR(A9=""),"",
IF(AND(D3="yes"),IF(OR(A3={"D","DT","V","X"}),(J9*5%+125),0))+
IF(AND(D3="yes"),IF(OR(A3={"GE","SR","VP"}),(D9*E6),0))+
IF(OR(A3={"B","H","L","M","MD","MN","N","NO","Q","R","W","WG","Y"}),
IF(AND(D3="yes"),IF(AND(A9<3333.34),(D9*E6),200))))
 
Last edited:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I have multiple tabs that use the same formula in different places on their sheets. I am trying to make maintaining them easier. I thought if I was able to do a vlookup it would help to accomplish this. Due to different calculations, I am forced to have some alpha characters in 2 of the If statements. For the last If statement, it should default to the remaining alpha and do a vlookup without any alpha characters. The following rules apply:


  1. If A9=blank, do not do anything.
  2. If C3=NO, return 0
  3. If C3=Yes:
    1. and A3=D, DT, V, X - E9=J9*5%+125
    2. and A3=GE, SR, VP - E9=Vlookup col. 8*D9
    3. and A3=any other "alpha" and
      1. D9 <3333.34 - E9=Vlookup col. 8*d9
      2. If D9 >3333.33, E9=200

Hopefully this is a better explanation.
Ty
 
Last edited:
Upvote 0

The code below does work:

=IF(OR(A9=""),"",
IF(AND(D3="yes"),IF(OR(A3={"D","DT","V","X"}),(J9*5%+125),0))+
IF(AND(D3="yes"),IF(OR(A3={"GE","SR","VP"}),(D9*E6),0))+
IF(OR(A3={"B","H","L","M","MD","MN","N","NO","Q","R","W","WG","Y"}),
IF(AND(D3="yes"),IF(AND(A9<3333.34),(D9*E6),200))))
 
Upvote 0
UPDATE - I have the formula working except for Step 3.2 from post # 22. Based on what I am trying to do, with this step, I think I have to go back to my original formula. The reason for this is that I do not want 200 to be a value for anything but all other ALPHA characters that are not in the first 2 IF(AND statements:

=IF((A9=""),"",
IF(AND(D3="yes"),IF(OR(A3={"D","DT","V","X"}),(J9*5%+125),
IF(AND(D3="yes"),IF(OR(A3={"GE","SR","VP"}),IFERROR(VLOOKUP($A$3,'Company Info'!$A$1:$J$25,8,FALSE)*D9,0),
IF(AND(D3="yes"),IF(AND(A9<3333.34),IFERROR(VLOOKUP($A$3,'Company Info'!$A$1:$J$25,8,FALSE)*D9,0),0)))))))
 
Upvote 0
Your formula cell references don't match the ones in your description.

Best guess:

=IF(A9="","",IF(D3<>"Yes",0,IF(OR(A3={"D","DT","V","X"}),J9*5%+125,IF(OR(A3={"GE","SR","VP"}),IFERROR(VLOOKUP($A$3,'Company Info'!$A$1:$J$25,8,FALSE)*D9,0),IF(A9<3333.34,IFERROR(VLOOKUP($A$3,'Company Info'!$A$1:$J$25,8,FALSE)*D9,0),200)))))
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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