FORMULA HELP

markster

Well-known Member
Joined
May 23, 2002
Messages
579
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi everyone,
Just need a bit of help with a formula.

Basically, what I'm trying to write a formula on Sheet 1 that says if Cell A2 = Cell B2 on Sheet 2, AND, Cell m2 = Cell L2 on Sheet 2, apply my look up formula but if it they don't match, don't run the VLOOKUP just return "No". So I started the formula like this

IF(AND(A2=Sheet2!B2,M2=Sheet2!L2,(VLOOKUP etc, etc.), "No"

I just get a formula error - the lookup on it's own work fine it's when I try to add the IF(AND) can anyone help?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You have an opening "(" for your AND function, but are missing the closing ")".

Your formula should be structured like:
Excel Formula:
=IF(AND(A2=Sheet2!B2,M2=Sheet2!L2),VLOOKUP(...),"No")
 
Upvote 0
Solution
Ok thanks, but I've entered the formula (cell reference are different from the example above but I believe the formula is correct and still there is an error with your formula message.

=IF(AND(A2=Sheet2!A2,Sheet1!B2,Sheet2!B2,Sheet1!),VLOOKUP(Sheet2!A:B,2,0),"No")

The vlookup bit works fine on its own - any ideas?

Thanks,
Mark
 
Upvote 0
Actually error is SPILL
 
Last edited:
Upvote 0
Your VLOOKUP formula looks to be structured incorrectly.
I think you are missing the first argument, the value you are actually looking up.
Have you used VLOOKUP before? Do you understand how to set them up?
 
Upvote 0
Sorry I think I'm brain storm, I can see the error in my VLOOKUP formula - yes I use them a lot sorry to bother you
 
Upvote 0
You are welcome.

Note that I changed the solution to the reply that addresses your original question (and not the latest error).
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,964
Members
449,094
Latest member
Anshu121

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