IF AND function help: Differentiate with Similar Criteria

KuraiChikara

Board Regular
Joined
Nov 16, 2016
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
Hello,
I have an issue with an IF AND function that contains similar criteria.
Example: Agents have their days off and their week is formatted. IE: Tuesday/Wednesday off will look like this FYSM--R.

Some agents have 3 days off, Tuesday/Wednesday/Thursday off will look like this FYSM---

I have an IF AND formula to format this, but it's that 3rd day off that's causing issues.

Because the agent with the 3rd day off ALSO has Tu/We off, when I put in my formula, FYSM--R is put instead of FYSM---.

I don't know how to get Excel to differentiate "Oh he has Tuesday, Wednesday AND Thursdays off, put FYSM---" Instead, it sees the first matching criteria and puts FYSM--R instead.

Grid explanation:
Everything RIGHT of WEEK FORMULA (Column E) is the reference data for my formula

=IF(AND(B2=$J$1,C2=$K$1),$F$2,IF(AND(B3=$J$1,C3=$K$1,D3=$L$1),$F$3,"NO MATCH"))

The result I want:
John should have FYSM--R
Bill should have FYSM---

AgentOff1Off2Off3Week FormulaWeeksSaSuMoTuWeThFr
JohnTuWeFYSM--RFYSM--R
BillTuWeThFYSM--RFYSM---

<tbody>
</tbody>
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,

Just reverse the order of the IF tests:


Book1
ABCDEFGHIJKLM
1AgentOff1Off2Off3Week FormulaWeeksSaSuMoTuWeThFr
2JohnTuWeFYSM--RFYSM--R
3BillTuWeThFYSM---FYSM---
Sheet215
Cell Formulas
RangeFormula
E2=IF(AND(B2=$J$1,C2=$K$1,D2=$L$1),$F$3,IF(AND(B2=$J$1,C2=$K$1),$F$2,"NO MATCH"))
 
Upvote 0
Hi,

Just reverse the order of the IF tests:

ABCDEFGHIJKLM
1AgentOff1Off2Off3Week FormulaWeeksSaSuMoTuWeThFr
2JohnTuWeFYSM--RFYSM--R
3BillTuWeThFYSM---FYSM---

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet215

Worksheet Formulas
CellFormula
E2=IF(AND(B2=$J$1,C2=$K$1,D2=$L$1),$F$3,IF(AND(B2=$J$1,C2=$K$1),$F$2,"NO MATCH"))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


How do you copy and paste pictures of your excel spreadsheet like you have jtakw?
 
Upvote 0
I actually have the same question as a the user before me, how do you insert excel images? My examples would be much better if I could do that. The only way I've been able to think of how to do it on this site is to use a photo sharing site to upload images and use the insert image page here. Is that how you do it?
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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