IF AND Function where the Logical Criteria is Text Help

KuraiChikara

Board Regular
Joined
Nov 16, 2016
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
Hello, I am trying to perform an IF AND function where the logical function in the IF portion is text on a different sheet or tab.
In the example below I was using different tabs on the same sheet:

Sheet 1:
NameDayFormula
JohnSunday
JimMonday
BobTuesday
BillWednesday
SteveThursday
OwenFriday
LukeSaturday

<tbody>
</tbody>


Sheet 2:
NameDayFruit
JohnSundayWatermelon
JimMondayApple
BobTuesdayKiwi
BillWednesdayStrawberry
SteveThursdayGrapes
OwenFridayHoneydew
LukeSaturdayBlueberry

<tbody>
</tbody>

With my example I can use this formula and have it WORK:
=IF(AND(A2=Sheet2!A2,B2),Sheet2!C2,"NO MATCH")

Verbally the formula should read: If A2 equals John AND Sunday in sheet 2, put C2 or Watermelon, if it doesnt match, put "no match."
Here is my issue.

For that formula to work, in sheet 2, I have to pin point where "John" is, but what if "John" is on A1063 on sheet 2? What I would like to do, is search for if John is a match without having to designate where John is.

I've tried this and it doesnt work:
=IF(AND(A2=Sheet2!"John",B2),Sheet2!C2,"NO MATCH")
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
use INDEX and MATCH for this im using 10000 as a safe amount of values in your list

=INDEX(Sheet2!$C$2:$C$10000,MATCH($A2&$B2,Sheet2!$A$2:$A$10000&Sheet2!$B$2:$B$10000,0))

That should give you your result

**** This is an array formula, make sure instead of just hitting ENTER, you do CTRL + SHIFT + ENTER ****
 
Upvote 0
That works, you are a genius thank you very much. I'm ok with Excel, but almost all of the Array type formulas I tend to never use. This has helped me a lot.
 
Upvote 0
No problem, glad i could help

Everything ive learned for Excel i give credit 100% to MrExcel!
 
Upvote 0

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

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