Possible Syntax error with lookup formula

mfd2112

Board Regular
Joined
Jan 2, 2010
Messages
86
This formula</SPAN>

IF(AND(J7<=0),NOT(ISBLANK(D7),VLOOKUP(D7,Miles!$C$3:$R$12,16,0)),0)</SPAN>

Must be written wrong.</SPAN>

I would like to have K7 use VLOOKUP to find a value if J7<=0 and D7 NOT(ISBLANK, but if J7 is > 0 and D7 is blank then K7 would contain 0.000</SPAN>

Any help is appreciated,</SPAN>

Dale.</SPAN>
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Just some misplaced parens
The one highlighted RED is ENDING the AND function, and should be after the NOT function.
The one highlighted BLUE should be ending the NOT function.
IF(AND(J7<=0),NOT(ISBLANK(D7),VLOOKUP(D7,Miles!$C$3:$R$12,16,0)),0)

IF(AND(J7<=0,NOT(ISBLANK(D7))),VLOOKUP(D7,Miles!$C$3:$R$12,16,0),0)
 

Watch MrExcel Video

Forum statistics

Threads
1,123,323
Messages
5,600,954
Members
414,417
Latest member
Nobu

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
Top