CONDITIONAL FORMATTING NEEDED TO SKIP EMPTY ROWS UNTIL THE NEXT SECTION OF DATA

JuicyMusic

Board Regular
Joined
Jun 13, 2020
Messages
210
Office Version
  1. 365
Platform
  1. Windows
Hello, I am quickly learning how to set up more complex conditional formatting by coming here and reading other posts and solutions. I am so excited
to see how to do adjust or write this CF that I now need..... but this one is beyond me at this point.........Thank you Mr.Excel!!

I have 2 CF's on one continuous spreadsheet (no blank rows) that alternates between two colors based on the job number change in column E.
but now I have had to revise the spreadsheet and now need the CF to skip blank rows - and then to start formatting again at the next section of data (going down) - at the first occurrence of either of these three texts (they will never be any other text):

JSA
TAIL GATE MEETING
PANDEMIC JOB HAZARD ANALYSIS

1) The header row of the 1st section of data may vary. Please let me know if it should be fixed. If it should be fixed then the header of the 1st section will always start on row 13.
2) The CF should encompass columns D thru G.
3) The trigger for the next color is the Job Number in column E
4) The number of sections of data will vary
4) The number of rows per section of data will vary. From 13 rows at the minimum to 75 rows. In case you need to know (but I don't think so :) )
5) The header names of the 4 columns will not change. Same for each section. See snippet uploaded.

I'm asking for assistance so that I don't have to set the same CF over and over again for every section. Here is a snapshot of my spreadsheet and the CF. Thank you!!

CF 1:
Excel Formula:
=AND($E14<>"",MOD(ROWS(UNIQUE($E$14:$E14)),2)=0)
CF 2:
Excel Formula:
=AND($E14<>"",MOD(ROWS(UNIQUE($E$14:$E14)),2)=1)
 

Attachments

  • Capture_Showing bottom of one section....blank rows between....then top of next section.PNG
    Capture_Showing bottom of one section....blank rows between....then top of next section.PNG
    66.2 KB · Views: 17
  • Capture_pic of CF box.PNG
    Capture_pic of CF box.PNG
    13 KB · Views: 17

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Is this what you want?
As I'm using XL2010 I don't have the UNIQUE function, so the formulas are more complex, but they should also work in 365.

11082021 Testes.xlsx
DEFG
13Full NameJob #DateForm Name
14Name1A01/01/2021Pandemic
15Name1A02/01/2021Tail
16Name1B03/01/2021JSA
17Name1B04/01/2021Pandemic
18Name1C05/01/2021JSA
19Name1C06/01/2021Tail
20Name1D07/01/2021Pandemic
21Name1D08/01/2021JSA
22Name1E09/01/2021Tail
23Name1F10/01/2021Pandemic
24Name1F11/01/2021JSA
25Name1F12/01/2021Tail
26Name1G13/01/2021JSA
27Name1G14/01/2021Tail
28
29
30
31
32
33
34
35Full NameJob #DateForm Name
36Name2H15/01/2021JSA
37Name2I16/01/2021Pandemic
38Name2I17/01/2021Tail
39Name2J18/01/2021Pandemic
40Name2K19/01/2021Tail
41Name2K20/01/2021JSA
42Name2L21/01/2021Pandemic
43
44
45
Plan8
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D14:G105Expression=E($E14<>"";$E14<>"Job #";MOD(SOMA(SE(FREQÜÊNCIA(SE($E$14:$E14<>"";SE($E$14:$E14<>"Job #";CORRESP($E$14:$E14;$E$14:$E14;0)));LIN($E$14:$E14)-LIN($E$14)+1);1));2)=0)textNO
D14:G105Expression=E($E14<>"";$E14<>"Job #";MOD(SOMA(SE(FREQÜÊNCIA(SE($E$14:$E14<>"";SE($E$14:$E14<>"Job #";CORRESP($E$14:$E14;$E$14:$E14;0)));LIN($E$14:$E14)-LIN($E$14)+1);1));2)=1)textNO


Translating the CF formulas to English
=AND($E14<>"",$E14<>"Job #",MOD(SUM(IF(FREQUENCY(IF($E$14:$E14<>"",IF($E$14:$E14<>"Job #",MATCH($E$14:$E14,$E$14:$E14,0))),ROW($E$14:$E14)-ROW($E$14)+1),1)),2)=1)
Fill --> Light orange

=AND($E14<>"",$E14<>"Job #",MOD(SUM(IF(FREQUENCY(IF($E$14:$E14<>"",IF($E$14:$E14<>"Job #",MATCH($E$14:$E14,$E$14:$E14,0))),ROW($E$14:$E14)-ROW($E$14)+1),1)),2)=0)
Fill --> Light green

Hope this helps

M.
 
Upvote 0
Another option for 365
+Fluff 1.xlsm
DEFG
13Full NameJob #DateForm Name
14Name1A01/01/2021Pandemic
15Name1A02/01/2021Tail
16Name1B03/01/2021JSA
17Name1B04/01/2021Pandemic
18Name1C05/01/2021JSA
19Name1C06/01/2021Tail
20Name1D07/01/2021Pandemic
21Name1D08/01/2021JSA
22Name1E09/01/2021Tail
23Name1F10/01/2021Pandemic
24Name1F11/01/2021JSA
25Name1F12/01/2021Tail
26Name1G13/01/2021JSA
27Name1G14/01/2021Tail
28
29
30
31
32
33
34
35Full NameJob #DateForm Name
36Name2H15/01/2021JSA
37Name2I16/01/2021Pandemic
38Name2I17/01/2021Tail
39Name2J18/01/2021Pandemic
40Name2K19/01/2021Tail
41Name2K20/01/2021JSA
42Name2L21/01/2021Pandemic
43
44
Main
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D14:G100Expression=AND($E14<>"",$E13<>"",MOD(COUNTA(UNIQUE($E$13:$E14)),2)=0)textNO
D14:G100Expression=AND($E14<>"",$E13<>"",MOD(COUNTA(UNIQUE($E$13:$E14)),2)<>0)textNO
 
Upvote 0
Solution
Fluff,

Just out of curiosity, would this work in 365?
=AND($E14<>"",$E13<>"",MOD(ROWS(UNIQUE(FILTER($E$13:$E14,$E$13:$E14"<>"))),2)=0)

M.
 
Upvote 0
With a minor tweak, yes
+Fluff 1.xlsm
DEFG
13Full NameJob #DateForm Name
14Name1A01/01/2021Pandemic
15Name1A02/01/2021Tail
16Name1B03/01/2021JSA
17Name1B04/01/2021Pandemic
18Name1C05/01/2021JSA
19Name1C06/01/2021Tail
20Name1D07/01/2021Pandemic
21Name1D08/01/2021JSA
22Name1E09/01/2021Tail
23Name1F10/01/2021Pandemic
24Name1F11/01/2021JSA
25Name1F12/01/2021Tail
26Name1G13/01/2021JSA
27Name1G14/01/2021Tail
28
29
30
31
32
33
34
35Full NameJob #DateForm Name
36Name2H15/01/2021JSA
37Name2I16/01/2021Pandemic
38Name2I17/01/2021Tail
39Name2J18/01/2021Pandemic
40Name2K19/01/2021Tail
41Name2K20/01/2021JSA
42Name2L21/01/2021Pandemic
43
44
45
46
Main
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G14:G46Expression=AND($E14<>"",$E13<>"",MOD(ROWS(UNIQUE(FILTER($E$13:$E14,$E$13:$E14<>""))),2)<>0)textNO
G14:G46Expression=AND($E14<>"",$E13<>"",MOD(ROWS(UNIQUE(FILTER($E$13:$E14,$E$13:$E14<>""))),2)=0)textNO
D14:G100Expression=AND($E14<>"",$E13<>"",MOD(COUNTA(UNIQUE($E$13:$E14)),2)=0)textNO
D14:G100Expression=AND($E14<>"",$E13<>"",MOD(COUNTA(UNIQUE($E$13:$E14)),2)<>0)textNO
 
Upvote 0
Hello Marcelo, I did use your first set and it freaked the CF box out....I had to close the spreadsheet. It looked like it colored the header of the next section instead of the 1st row below the header row of each new section.

Thank you so so much for your input. I actually printed out this whole post because I want to breakdown each that you guys sent me. All of them.

Fluff, Your formula worked great. Thank you again for solving. If I can talk the formula out then I can write these.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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