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:
The code returned a false

New sheet:

A3 = D
D3 = Yes
A9 = )
J9 = 5

Formula in A1
Code:
=IF(A9=")",IF(AND(ISNUMBER(MATCH($A$3,{"D","DT","SR","V","X"},0)),$D$3="YES"),J9*5%+125))
Returns 125.25

Formula in L9
Code:
=IF(A9=")",IF(AND(ISNUMBER(MATCH($A$3,{"D","DT","SR","V","X"},0)),$D$3="YES"),J9*5%+125))
Also returns 125.25

Both not FALSE for me

 
Last edited:
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I can get A1 to work. When I add the additional test, I receive there is a problem with the formula:

=IF(A9="","",IF(OR($A$3={"D","DT","V","X"}),IF($D$3="YES",J9*5%+125,99)),
if(or($A$3={"GE","SR","VP"},if($D$3="YES",VLOOKUP($A$3,'Company Info'!$A$1:$L$25,8,FALSE)*D9)))
 
Upvote 0
=IF(A9=")",IF(AND(ISNUMBER(MATCH($A$3,{"D","DT","SR","V","X"},0)),$D$3="YES"),J9*5%+125))

Filing/Fees
FALSE

<tbody>
</tbody>
Company Code
DT - this is A3

<tbody>
</tbody>
 
Last edited:
Upvote 0
Mine returns 125.5 when A3 = "DT"


As stated, in a new sheet, with the values given, suggests there is something else not detailed if we're getting different results.
 
Last edited:
Upvote 0
dtyes
1200FALSE

<colgroup><col width="87" span="5" style="width: 65pt;"></colgroup><tbody>
</tbody>
 
Upvote 0
What cells are those values in? Try:
Code:
=IF(A9="",IF(AND(ISNUMBER(MATCH($A$3,{"D","DT","SR","V","X"},0)),$D$3="YES"),J9*5%+125))
 
Last edited:
Upvote 0
Same results

DT - A3YES - C3
1200 - A9FALSE200 - J9

<colgroup><col width="87" span="10" style="width: 65pt;"></colgroup><tbody>
</tbody>
 
Upvote 0
C3 or D3? And your formula is testing if A9="" without a FALSE condition, since A9 is 1200, it would return FALSE
Try:
Rich (BB code):
=IF(A9="",--(AND(ISNUMBER(MATCH($A$3,{"D","DT","SR","V","X"},0)),$C$3="YES")*J9*5%+125),VLOOKUP($A$3,'Company Info'!$A$1:$L$25,8,0)*D9)
Adjust as required
 
Upvote 0
It is C3 - I tested with a value in A9 and also without a value.

I am still receiving a false with just:

=IF(A9="",--(AND(ISNUMBER(MATCH($A$3,{"D","DT","V","X"},0)),$C$3="YES")*J9*5%+125))
 
Upvote 0

Excel 2010
BCDEF
1130130130
4d
Cell Formulas
RangeFormula
B1=(OR($A$3={"D","DT","SR","V","X"}))*($C$3="YES")*(J9*5%+125)*(D9<3333.34)
E1=IF(A9="",AND(ISNUMBER(MATCH($A$3,{"D","DT","V","X"},0))),($C$3="YES"))*J9*5%+125
F1=ISNUMBER(MATCH($A$3,{"D","DT","V","X"},0))*($C$3="YES")*J9*5%+125



If would really help if you posted an example of your challenge and explained what you require.
A random edit of formulas that do not work is no very constructive.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,587
Messages
6,131,586
Members
449,657
Latest member
Timber5

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