conditional formatting with multiple conditions

kelvin_9

Active Member
Joined
Mar 6, 2015
Messages
472
Office Version
  1. 2019
greeting to all

is there any better formula/solution i can use instead of these 13 formulas i am using?
i need "abc" or "def" to be green, "UNASSIGNEDSHIFT UNASSIGNEDSHIFT" to be yellow, other than these* to be blue
*sometimes more than 5 criteria

thank you very much for your help


temp.xls
ABCDE
2Part Time - WEIMX
3Part Time - Flexabc
4Full Timeabc
5Full Timeabc
6Full Timeabc
7Full Timedef
8Full Timeabc
9Full Timeabc
10Full Timeabc
11Part Time - WEabc
12Part Time - WEabc
13Full Timeabc
14Full Timeabc
15Full Timeabc
16Full Timeabc
17Full Timeabc
18Part Time - WEabc
19Part Time - WEdef
20Part Time - WEdef
21Part Time - WEabc
22Full Timedef
23Part Time - WEabc
24Part Time - WEdef
25Part Time - WEdef
26Part Time - WEabc
27Full Timeabc
28Full Timeabc
29Full Timedef
30Full Timedef
31Full Timedef
32Part Time - WEabc
33Part Time - WEabc
34Full Timeabc
35Part Time - WEdef
36Part Time - WEabc
37Part Time - WEabc
38Full Timeabc
39Part Time - WEdef
40Part Time - WEabc
41Part Time - WEabc
42Part Time - WEdef
43Full Timeabc
44Part Time - WEabc
45Part Time - WEabc
46Part Time - WEabc
47Part Time - WEabc
48Part Time - WEabc
49Part Time - WEdef
50Part Time - WEabc
51Part Time - WEabc
52Part Time - WEabc
53Full Timedef
54Full Timeabc
55Full Timeabc
56Full Timeabc
57Full Timedef
58Part Time - WEdef
59Full Timeabc
60Full Timeabc
61Full Timeabc
62Part Time - WEEMP
63Part Time - Flexabc
64Part Time - Flexabc
65Full Timeabc
66Full Timeabc
67Full Timeabc
68Full Timeabc
69Full Timeabc
70Full Timeabc
71Full Timeabc
72Full Timedef
73Part Time - WDabc
74Full Timeabc
75Full Timeabc
76Full Timeabc
77Full Timeabc
78Full Timeabc
79Part Time - WDabc
80Full Timeabc
81Part Time - Flexabc
82Part Time - WDdef
83Full Timeabc
84Part Time - WDabc
85Full Timedef
86Full Timedef
87Part Time - FlexEMP
88Part Time - Flexdef
89Full Timeabc
90Part Time - WDabc
91Part Time - WDabc
92Part Time - WDdef
93Part Time - WDabc
94Part Time - Flexabc
95Part Time - Flexabc
96Part Time - WDdef
97Full Timeabc
98Full Timeabc
99Part Time - WDabc
100Part Time - WDabc
101Part Time - WDabc
102Part Time - WDabc
103Part Time - Flexabc
104Full Timedef
105Part Time - Flexabc
106Full Timeabc
107Part Time - Flexabc
108Part Time - WDdef
109Full Timeabc
110Full Timeabc
111Full Timedef
112Full Timeabc
113Full Timeabc
114Full Timeabc
115Full Timeabc
116Full Timeabc
117Full Timeabc
118Full Timeabc
119Part Time - WDEMP
120Part Time - Flexabc
121Full Timeabc
122Part Time - WDabc
123Full Timeabc
124Full Timeabc
125Full Timeabc
126Full Timeabc
127Full Timeabc
128Full Timeabc
129Full Timedef
130Full Timeabc
131Full Timeabc
132Full Timeabc
133Full Timeabc
134Part Time - WDabc
135Full Timeabc
136Part Time - WDdef
137Part Time - WDdef
138Full Timeabc
139Part Time - Flexabc
140Full Timedef
141Full Timedef
142Part Time - FlexEMP
143Part Time - Flexabc
144Part Time - WDabc
145Full Timedef
146Part Time - FlexEMP
147Part Time - WDabc
148Part Time - WDabc
149Part Time - WDabc
150Part Time - WDabc
151Part Time - WDabc
152Full Timedef
153Full Timedef
154UNASSIGNEDSHIFT UNASSIGNEDSHIFT
155Part Time - WDEMP
156Part Time - WDEMP
157Part Time - FlexEMP
158Part Time - WDEMP
159Part Time - WDEMP
160Part Time - FlexEMP
161Part Time - WDEMP
162Part Time - WDdef
163Full Timeabc
164Full Timeabc
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E10000Expression=AND(A2="Part Time - WD",C2="imx")textYES
E2:E10000Expression=AND(A2="Part Time - Flex",C2="imx")textYES
E2:E10000Expression=AND(A2="Part Time - WE",C2="imx")textYES
E2:E10000Expression=AND(A2="Part Time - WD",C2="emp")textYES
E2:E10000Expression=AND(A2="Part Time - Flex",C2="emp")textYES
E2:E10000Expression=AND(A2="Part Time - WE",C2="emp")textYES
E2:E10000Expression=AND(A2="",C2="",E2="UNASSIGNEDSHIFT UNASSIGNEDSHIFT")textYES
E2:E10000Expression=AND(A2="Part Time - WD",C2="def")textYES
E2:E10000Expression=AND(A2="Part Time - Flex",C2="def")textYES
E2:E10000Expression=AND(A2="Part Time - WE",C2="def")textYES
E2:E10000Expression=AND(A2="Part Time - WD",C2="abc")textYES
E2:E10000Expression=AND(A2="Part Time - Flex",C2="abc")textYES
E2:E10000Expression=AND(A2="Part Time - WE",C2="abc")textYES
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
i need "abc" or "def" to be green, "UNASSIGNEDSHIFT UNASSIGNEDSHIFT" to be yellow, other than these* to be blue
Not quite sure about this as it does not match your mini sheet, but do these three rules help?

25 01 26.xlsm
ABCDE
2Part Time - WEIMX
3Part Time - Flexabc
4Full Timeabc
5Full Timeabc
6Full Timeabc
7Full Timedef
8Full Timeabc
9Full Timeabc
10Full Timeabc
11Part Time - WEabc
12Part Time - WEabc
13Full Timeabc
14Full Timeabc
15Full Timeabc
16Full Timeabc
17Full Timeabc
18Part Time - WEabc
19Part Time - WEdef
20Part Time - WEdef
21Part Time - WEabc
22Full Timedef
23Part Time - WEabc
24Part Time - WEdef
25Part Time - WEdef
26Part Time - WEabc
27Full Timeabc
28Full Timeabc
29Full Timedef
30Full Timedef
31Full Timedef
32Part Time - WEabc
33Part Time - WEabc
34Full Timeabc
35Part Time - WEdef
36Part Time - WEabc
37Part Time - WEabc
38Full Timeabc
39Part Time - WEdef
40Part Time - WEabc
41Part Time - WEabc
42Part Time - WEdef
43Full Timeabc
44Part Time - WEabc
45Part Time - WEabc
46Part Time - WEabc
47Part Time - WEabc
48Part Time - WEabc
49Part Time - WEdef
50Part Time - WEabc
51Part Time - WEabc
52Part Time - WEabc
53Full Timedef
54Full Timeabc
55Full Timeabc
56Full Timeabc
57Full Timedef
58Part Time - WEdef
59Full Timeabc
60Full Timeabc
61Full Timeabc
62Part Time - WEEMP
63Part Time - Flexabc
64Part Time - Flexabc
65Full Timeabc
66Full Timeabc
67Full Timeabc
68Full Timeabc
69Full Timeabc
70Full Timeabc
71Full Timeabc
72Full Timedef
73Part Time - WDabc
74Full Timeabc
75Full Timeabc
76Full Timeabc
77Full Timeabc
78Full Timeabc
79Part Time - WDabc
80Full Timeabc
81Part Time - Flexabc
82Part Time - WDdef
83Full Timeabc
84Part Time - WDabc
85Full Timedef
86Full Timedef
87Part Time - FlexEMP
88Part Time - Flexdef
89Full Timeabc
90Part Time - WDabc
91Part Time - WDabc
92Part Time - WDdef
93Part Time - WDabc
94Part Time - Flexabc
95Part Time - Flexabc
96Part Time - WDdef
97Full Timeabc
98Full Timeabc
99Part Time - WDabc
100Part Time - WDabc
101Part Time - WDabc
102Part Time - WDabc
103Part Time - Flexabc
104Full Timedef
105Part Time - Flexabc
106Full Timeabc
107Part Time - Flexabc
108Part Time - WDdef
109Full Timeabc
110Full Timeabc
111Full Timedef
112Full Timeabc
113Full Timeabc
114Full Timeabc
115Full Timeabc
116Full Timeabc
117Full Timeabc
118Full Timeabc
119Part Time - WDEMP
120Part Time - Flexabc
121Full Timeabc
122Part Time - WDabc
123Full Timeabc
124Full Timeabc
125Full Timeabc
126Full Timeabc
127Full Timeabc
128Full Timeabc
129Full Timedef
130Full Timeabc
131Full Timeabc
132Full Timeabc
133Full Timeabc
134Part Time - WDabc
135Full Timeabc
136Part Time - WDdef
137Part Time - WDdef
138Full Timeabc
139Part Time - Flexabc
140Full Timedef
141Full Timedef
142Part Time - FlexEMP
143Part Time - Flexabc
144Part Time - WDabc
145Full Timedef
146Part Time - FlexEMP
147Part Time - WDabc
148Part Time - WDabc
149Part Time - WDabc
150Part Time - WDabc
151Part Time - WDabc
152Full Timedef
153Full Timedef
154UNASSIGNEDSHIFT UNASSIGNEDSHIFT
155Part Time - WDEMP
156Part Time - WDEMP
157Part Time - FlexEMP
158Part Time - WDEMP
159Part Time - WDEMP
160Part Time - FlexEMP
161Part Time - WDEMP
162Part Time - WDdef
163Full Timeabc
164Full Timeabc
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E1000Expression=AND(A2="",C2="",E2="UNASSIGNEDSHIFT UNASSIGNEDSHIFT")textNO
E2:E1000Expression=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|emp|imx|"))textNO
E2:E1000Expression=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|abc|def|"))textNO
 
Upvote 0
Not quite sure about this as it does not match your mini sheet, but do these three rules help?

25 01 26.xlsm
ABCDE
2Part Time - WEIMX
3Part Time - Flexabc
4Full Timeabc
5Full Timeabc
6Full Timeabc
7Full Timedef
8Full Timeabc
9Full Timeabc
10Full Timeabc
11Part Time - WEabc
12Part Time - WEabc
13Full Timeabc
14Full Timeabc
15Full Timeabc
16Full Timeabc
17Full Timeabc
18Part Time - WEabc
19Part Time - WEdef
20Part Time - WEdef
21Part Time - WEabc
22Full Timedef
23Part Time - WEabc
24Part Time - WEdef
25Part Time - WEdef
26Part Time - WEabc
27Full Timeabc
28Full Timeabc
29Full Timedef
30Full Timedef
31Full Timedef
32Part Time - WEabc
33Part Time - WEabc
34Full Timeabc
35Part Time - WEdef
36Part Time - WEabc
37Part Time - WEabc
38Full Timeabc
39Part Time - WEdef
40Part Time - WEabc
41Part Time - WEabc
42Part Time - WEdef
43Full Timeabc
44Part Time - WEabc
45Part Time - WEabc
46Part Time - WEabc
47Part Time - WEabc
48Part Time - WEabc
49Part Time - WEdef
50Part Time - WEabc
51Part Time - WEabc
52Part Time - WEabc
53Full Timedef
54Full Timeabc
55Full Timeabc
56Full Timeabc
57Full Timedef
58Part Time - WEdef
59Full Timeabc
60Full Timeabc
61Full Timeabc
62Part Time - WEEMP
63Part Time - Flexabc
64Part Time - Flexabc
65Full Timeabc
66Full Timeabc
67Full Timeabc
68Full Timeabc
69Full Timeabc
70Full Timeabc
71Full Timeabc
72Full Timedef
73Part Time - WDabc
74Full Timeabc
75Full Timeabc
76Full Timeabc
77Full Timeabc
78Full Timeabc
79Part Time - WDabc
80Full Timeabc
81Part Time - Flexabc
82Part Time - WDdef
83Full Timeabc
84Part Time - WDabc
85Full Timedef
86Full Timedef
87Part Time - FlexEMP
88Part Time - Flexdef
89Full Timeabc
90Part Time - WDabc
91Part Time - WDabc
92Part Time - WDdef
93Part Time - WDabc
94Part Time - Flexabc
95Part Time - Flexabc
96Part Time - WDdef
97Full Timeabc
98Full Timeabc
99Part Time - WDabc
100Part Time - WDabc
101Part Time - WDabc
102Part Time - WDabc
103Part Time - Flexabc
104Full Timedef
105Part Time - Flexabc
106Full Timeabc
107Part Time - Flexabc
108Part Time - WDdef
109Full Timeabc
110Full Timeabc
111Full Timedef
112Full Timeabc
113Full Timeabc
114Full Timeabc
115Full Timeabc
116Full Timeabc
117Full Timeabc
118Full Timeabc
119Part Time - WDEMP
120Part Time - Flexabc
121Full Timeabc
122Part Time - WDabc
123Full Timeabc
124Full Timeabc
125Full Timeabc
126Full Timeabc
127Full Timeabc
128Full Timeabc
129Full Timedef
130Full Timeabc
131Full Timeabc
132Full Timeabc
133Full Timeabc
134Part Time - WDabc
135Full Timeabc
136Part Time - WDdef
137Part Time - WDdef
138Full Timeabc
139Part Time - Flexabc
140Full Timedef
141Full Timedef
142Part Time - FlexEMP
143Part Time - Flexabc
144Part Time - WDabc
145Full Timedef
146Part Time - FlexEMP
147Part Time - WDabc
148Part Time - WDabc
149Part Time - WDabc
150Part Time - WDabc
151Part Time - WDabc
152Full Timedef
153Full Timedef
154UNASSIGNEDSHIFT UNASSIGNEDSHIFT
155Part Time - WDEMP
156Part Time - WDEMP
157Part Time - FlexEMP
158Part Time - WDEMP
159Part Time - WDEMP
160Part Time - FlexEMP
161Part Time - WDEMP
162Part Time - WDdef
163Full Timeabc
164Full Timeabc
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E1000Expression=AND(A2="",C2="",E2="UNASSIGNEDSHIFT UNASSIGNEDSHIFT")textNO
E2:E1000Expression=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|emp|imx|"))textNO
E2:E1000Expression=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|abc|def|"))textNO
thank you very much for you reply, Peter_SSs

this is just prefect and doing what i am doing in these 13 formulas
save my life!!

i am curious if i has another crietria like i said, is it simply add like:
AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|emp|imx|aaa|zzz"))

last but not least
i just add "no" in column J to identify who are non-cashier skill set and i want this result to be grey in column E
what should i need to modify this?
=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|abc|def|"))

thank you very much for you guidance

temp.xls
ABCDEFGHIJ
2Part Time - WEIMX12/29/20248:158:45
3Part Time - Flexabc12/29/20248:1517:45no
4Full Timeabc12/29/20248:1517:45
5Full Timeabc12/29/20248:1517:45
6Full Timeabc12/29/20248:1517:45
7Full Timedef12/29/20248:1517:45
8Full Timeabc12/29/20248:1517:45
9Full Timeabc12/29/20248:3018:00
10Full Timeabc12/29/20248:3018:00
11Part Time - WEabc12/29/20248:3018:00no
12Part Time - WEabc12/29/20248:3018:00no
13Full Timeabc12/29/20248:3018:00
14Full Timeabc12/29/20248:3018:00
15Full Timeabc12/29/20248:3018:00
16Full Timeabc12/29/20248:3018:00
17Full Timeabc12/29/20248:3018:00
18Part Time - WEabc12/29/20249:0018:30
19Part Time - WEdef12/29/20249:0018:30
20Part Time - WEdef12/29/20249:0018:30
21Part Time - WEabc12/29/20249:0018:30
22Full Timedef12/29/20249:0018:30
23Part Time - WEabc12/29/20249:0018:30
24Part Time - WEdef12/29/20249:0018:30
25Part Time - WEdef12/29/20249:0018:30
26Part Time - WEabc12/29/20249:0018:30
27Full Timeabc12/29/20249:0018:30
28Full Timeabc12/29/20249:0018:30
29Full Timedef12/29/20249:0018:30
30Full Timedef12/29/20249:0018:30
31Full Timedef12/29/20249:0018:30
32Part Time - WEabc12/29/20249:0018:30
33Part Time - WEabc12/29/20249:0018:30
34Full Timeabc12/29/20249:0018:30
35Part Time - WEdef12/29/20249:0018:30
36Part Time - WEabc12/29/20249:0018:30
37Part Time - WEabc12/29/20249:0018:30
38Full Timeabc12/29/202410:0019:30
39Part Time - WEdef12/29/202410:1517:45
40Part Time - WEabc12/29/202412:0021:30
41Part Time - WEabc12/29/202412:0021:30
42Part Time - WEdef12/29/202412:0021:30
43Full Timeabc12/29/202412:0021:30
44Part Time - WEabc12/29/202412:3022:00
45Part Time - WEabc12/29/202412:3022:00
46Part Time - WEabc12/29/202412:3022:00
47Part Time - WEabc12/29/202413:4523:15
48Part Time - WEabc12/29/202413:4523:15
49Part Time - WEdef12/29/202413:4523:15
50Part Time - WEabc12/29/202413:4523:15
51Part Time - WEabc12/29/202413:4523:15
52Part Time - WEabc12/29/202413:4523:15
53Full Timedef12/29/202413:4523:15
54Full Timeabc12/29/202413:4523:15
55Full Timeabc12/29/202413:4523:15
56Full Timeabc12/29/202413:4523:15
57Full Timedef12/29/202413:4523:15
58Part Time - WEdef12/29/202413:4523:15
59Full Timeabc12/29/202413:4523:15
60Full Timeabc12/29/202413:4523:15
61Full Timeabc12/29/202413:4523:15
62Part Time - WEEMP12/29/202416:3023:15
63Part Time - Flexabc12/30/20248:158:45
64Part Time - Flexabc12/30/20248:1517:45
65Full Timeabc12/30/20248:1517:45
66Full Timeabc12/30/20248:1517:45
67Full Timeabc12/30/20248:1517:45
68Full Timeabc12/30/20248:1517:45
69Full Timeabc12/30/20248:1517:45
70Full Timeabc12/30/20248:3018:00
71Full Timeabc12/30/20248:3018:00
72Full Timedef12/30/20248:3018:00
73Part Time - WDabc12/30/20248:3018:00no
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E2:E10000Expression=AND(A2="Part Time - WD",C2="imx")textYES
E2:E10000Expression=AND(A2="Part Time - Flex",C2="imx")textYES
E2:E10000Expression=AND(A2="Part Time - WE",C2="imx")textYES
E2:E10000Expression=AND(A2="Part Time - WD",C2="emp")textYES
E2:E10000Expression=AND(A2="Part Time - Flex",C2="emp")textYES
E2:E10000Expression=AND(A2="Part Time - WE",C2="emp")textYES
E2:E10000Expression=AND(A2="",C2="",E2="UNASSIGNEDSHIFT UNASSIGNEDSHIFT")textYES
E2:E10000Expression=AND(A2="Part Time - WD",C2="def")textYES
E2:E10000Expression=AND(A2="Part Time - Flex",C2="def")textYES
E2:E10000Expression=AND(A2="Part Time - WE",C2="def")textYES
E2:E10000Expression=AND(A2="Part Time - WD",C2="abc")textYES
E2:E10000Expression=AND(A2="Part Time - Flex",C2="abc")textYES
E2:E10000Expression=AND(A2="Part Time - WE",C2="abc")textYES
 
Upvote 0
this is just prefect and doing what i am doing in these 13 formulas
save my life!!
Good news! :)


i am curious if i has another crietria like i said, is it simply add like:
AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|emp|imx|aaa|zzz"))
You would use that to highlight any rows where column A started with a "P" and column C was any one of those items listed at the end, except that you must add the extra "|" character at the end so it would actually be
AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|emp|imx|aaa|zzz|"))


last but not least
i just add "no" in column J to identify who are non-cashier skill set and i want this result to be grey in column E
what should i need to modify this?
=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|abc|def|"))
This is not clear

i just add "no" in column J to identify who are non-cashier skill set and i want this result to be grey in column E
This implies grey if column J is "no" no mater what is in the other columns.

what should i need to modify this?
=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|abc|def|"))
This, combined with the sentence above, suggests that you may want a "P" in column A and "abc" or "def" in column C and "no" in column J before you make that row grey.

Which is it?
 
Upvote 0
Good news! :)



You would use that to highlight any rows where column A started with a "P" and column C was any one of those items listed at the end, except that you must add the extra "|" character at the end so it would actually be
AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|emp|imx|aaa|zzz|"))



This is not clear


This implies grey if column J is "no" no mater what is in the other columns.


This, combined with the sentence above, suggests that you may want a "P" in column A and "abc" or "def" in column C and "no" in column J before you make that row grey.

Which is it?
thank you very much for your reply, Peter_SSs

yes, your suggest is correct
i want "P" in column A and "abc" or "def" (or even more cretrias) in coulmn C and "no" in column J before E2:E10000 change to grey

thank you very much for you guidance
 
Upvote 0
Thanks for the clarification. Add a new rule for the grey. The CF formula for the new rule would be like this.
Excel Formula:
=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|abc|def|"),J2="no")
 
Upvote 0
Thanks for the clarification. Add a new rule for the grey. The CF formula for the new rule would be like this.
Excel Formula:
=AND(LEFT(A2,1)="P",SEARCH("|"&C2&"|","|abc|def|"),J2="no")
thank you very much for your reply, Peter_SSs

it works just prefect

thank you very much
 
Upvote 0

Forum statistics

Threads
1,225,897
Messages
6,187,704
Members
453,435
Latest member
U4US

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