IF(AND...?

SewStage

Board Regular
Joined
Mar 16, 2021
Messages
70
Office Version
  1. 365
Platform
  1. Windows
I feel like I'm missing the obvious here. On this tab below, column A lists kit names (KITNAME) and column B lists its associated kit category (KITCAT):
clip2.JPG


On the following tab, I want the cells in BD41-BJ45 to return a value of -1 if the entry in column B is listed in KITNAME above and the associated KITCAT matches BD1-BJ1:
clip1.JPG


Right now in cell BE50, my formula is: =IF(AND(B50=KITNAME,KITCAT=BE1),-1,) but it keeps returning a value of 0 (false) even though B50 is listed in KITNAME and the associated category does in fact match BD1.

If someone can point me to what I'm obviously doing wrong I'd appreciate it. Thanks so much. Ruth
 

Attachments

  • 1672711633462.png
    1672711633462.png
    33.6 KB · Views: 3

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Seems like you can use VLOOKUP:
Excel Formula:
=IF(IFERROR(VLOOKUP(B50,Sheet2!A:B,2,0),0)=BE1,-1,0)
Change 'Sheet2' to the worksheet name of your first tab.
 
Upvote 0
Solution
Glad it worked.

An improvement to lock the absolute column/row respectively, so that you can simply copy/paste the formula across the grid
Excel Formula:
=IF(IFERROR(VLOOKUP($B50,Sheet2!$A:$B,2,0),0)=BE$1,-1,0)
 
Upvote 0
That worked! Thanks so much @aRandomHelper!
The marked solution has been changed accordingly.
In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0
The marked solution has been changed accordingly.
In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
I thought I did, so my apologies if I marked the wrong one.
 
Upvote 0

Forum statistics

Threads
1,215,709
Messages
6,126,391
Members
449,311
Latest member
accessbob

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