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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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))

[TABLE="width: 109"]
<tbody>[TR]
[TD="class: xl70, width: 109, align: center"]Filing/Fees[/TD]
[/TR]
[TR]
[TD="class: xl72, width: 109, align: center"] FALSE[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl72, width: 108, align: center"]Company Code[/TD]
[/TR]
[TR]
[TD="class: xl73, align: center"]DT - this is A3[/TD]
[/TR]
</tbody>[/TABLE]
 
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
[TABLE="width: 435"]
<colgroup><col width="87" span="5" style="width: 65pt;"></colgroup><tbody>[TR]
[TD="width: 87"]dt[/TD]
[TD="width: 87"][/TD]
[TD="width: 87"]yes[/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]1200[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]FALSE[/TD]
[/TR]
</tbody>[/TABLE]
 
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

[TABLE="width: 870"]
<colgroup><col width="87" span="10" style="width: 65pt;"></colgroup><tbody>[TR]
[TD="width: 87"]DT - A3[/TD]
[TD="width: 87"][/TD]
[TD="width: 87"]YES - C3[/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[TD="width: 87"][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1200 - A9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: center"]FALSE[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]200 - J9[/TD]
[/TR]
</tbody>[/TABLE]
 
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,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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