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>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

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)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,384
Messages
5,836,940
Members
430,463
Latest member
mikmob

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