Simplifying AND/OR formula

Tigerexcel

Active Member
Joined
Mar 6, 2020
Messages
493
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Book2
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABAC
11/01/20212/01/20213/01/20214/01/20215/01/20216/01/20217/01/20218/01/20219/01/202110/01/202111/01/202112/01/202113/01/202114/01/202115/01/202116/01/202117/01/202118/01/202119/01/202120/01/202121/01/202122/01/202123/01/202124/01/202125/01/202126/01/202127/01/202128/01/2021
2JaneMonTueWedThuFriMonTueWedThuFriMonTueWedThuFriMonTueWedThuFri
3BobMonTueWedThuFriMonTueWedThuFriMonTueWedThuFriMonTueWedThuFri
4PeteMonTueWedThuFriMonTueWedThuFriMonTueWedThuFriMonTueWedThuFri
5HarryMonTueWedThuFriMonTueWedThuFriMonTueWedThuFriMonTueWedThuFri
6
7
8
9TRUETRUEFALSEFALSEFALSETRUETRUETRUETRUEFALSEFALSEFALSETRUETRUETRUETRUEFALSEFALSEFALSETRUETRUETRUETRUEFALSEFALSEFALSETRUETRUE
10FALSEFALSETRUEFALSEFALSETRUETRUEFALSEFALSETRUEFALSEFALSETRUETRUEFALSEFALSETRUEFALSEFALSETRUETRUEFALSEFALSETRUEFALSEFALSETRUETRUE
11FALSEFALSEFALSEFALSEFALSETRUETRUEFALSEFALSEFALSEFALSEFALSETRUETRUEFALSEFALSEFALSEFALSEFALSETRUETRUEFALSEFALSEFALSEFALSEFALSETRUETRUE
12FALSEFALSEFALSEFALSETRUETRUETRUEFALSEFALSEFALSEFALSETRUETRUETRUEFALSEFALSEFALSEFALSETRUETRUETRUEFALSEFALSEFALSEFALSETRUETRUETRUE
13
14
15Required
16JaneMonTue
17BobWed
18Pete
19HarryFri
Sheet1
Cell Formulas
RangeFormula
B9:AC12B9=AND($A2=$M16,OR(B2=$N16,B2=$O16,B2=$P16,B2=$Q16))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B9:AC12Expression=AND($A2=$M16,OR(B2=$N16,B2=$O16,B2=$P16))textNO
B2:AC5Expression=AND($A2=$M16,OR(B2=$N16,B2=$O16,B2=$P16,B2=$Q16))textNO

I need to modify the formula so that it ignores any blanks in the Required for work table starting in cell M15. Also, I have quite a number of ORs in my formula, is there a way to shorten this formula as this could get quite long in practice (for the sake of the example it only has Mon to Sun). Please ignore the TRUE/FALSE rows, that was there to help guide me with the CF.
Just to be clear, Columns G,H, N,O etc should not return true, I've tried NOT(ISBLANK) but couldn't get the desired result.
 

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
Book2
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABAC
1Fri 01-01-2102-01-2103-01-2104-01-2105-01-2106-01-2107-01-2108-01-2109-01-2110-01-2111-01-2112-01-2113-01-2114-01-2115-01-2116-01-2117-01-2118-01-2119-01-2120-01-2121-01-2122-01-2123-01-2124-01-2125-01-2126-01-2127-01-2128-01-21
2JaneMonTueWedThuFriMonTueWedThuFriMonTueWedThuFriMonTueWedThuFri
3BobMonTueWedThuFriMonTueWedThuFriMonTueWedThuFriMonTueWedThuFri
4PeteMonTueWedThuFriMonTueWedThuFriMonTueWedThuFriMonTueWedThuFri
5HarryMonTueWedThuFriMonTueWedThuFriMonTueWedThuFriMonTueWedThuFri
6
7
8
91100000110000011000001100000
100010000001000000100000010000
110000000000000000000000000000
120000100000010000001000000100
13
14
15Required
16000110JaneMonTue
17000001BobWed
18000000Pete
19TEXT(B$1,"ddd")[/COLOR])]100000HarryFri
Sheet1
Cell Formulas
RangeFormula
B9:AC12B9=COUNTIF(INDEX($N$16:$Q$19,MATCH($A2,$M$16:$M$19,),),B2)
B16:G19B16=COUNTIF(INDEX($N$16:$Q$19,MATCH($A2,$M$16:$M$19,),),TEXT(B$1,"ddd"))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:AC5Expression=COUNTIF(INDEX($N$16:$Q$19,MATCH($A2,$M$16:$M$19,),),B2)textNO


1 Jan 2021is Friday , You may use TEXT(B$1,"ddd") instead of B2
 
Upvote 0

Forum statistics

Threads
1,216,487
Messages
6,130,946
Members
449,608
Latest member
jacobmudombe

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