Conditional formatting cells up to first cell after group of consecutive zeros

xRockox

New Member
Joined
Sep 22, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello All,

Looking for a little help with conditional formatting that meets specific criteria. I would like to highlight rows in a column based on values in an adjacent column.

For reference, I have the data highlighted for which I would like the conditional formatting to do automatically.

The criteria is as follows:
Highlight data cells in column D up to the first data point that follows the first grouping of consecutive zeros in column C.

In the sample data below, this means that I would like to highlight cells D3:D26, since C26 contains the first value that follows a grouping of consecutive zeros in cells C8:C25.

Additionally, there will be other groupings of consecutive zeros in the data (e.g. C130:C168), but I only want to highlight this first occurrence.
Data values will also vary, so there may be instances where there may be more/less/or no values before the first grouping of consecutive zeros.
There may also be instances where the quantity of consecutive zeros vary.

Thanks in advance for any help!

Sample.xlsx
ABCD
1ABCD
2unitunitunitunit
31117.210.01
42213.460.01
532.999.080.01
643.994.920.01
754.992.640.01
865.9900.01
976.9900.01
1087.9900.01
1198.9900.01
12109.9900.01
131110.9900.01
141211.9900.01
151312.9900.01
161413.9900.01
171514.9900.01
181615.9900.01
19171700.01
20181800.01
21191900.01
22202000.01
23212100.01
24222200.01
25232300.01
2624248.980.02
27252511.660.02
28262614.910.02
29272717.120.03
30282817.160.03
31292918.310.04
32303021.010.04
33313121.60.05
34323222.530.05
353332.9922.30.06
363433.9921.870.07
373534.9921.270.07
383635.9920.640.08
393736.9920.220.08
403837.9919.580.09
413938.9917.240.09
424039.9914.670.1
434140.9913.80.1
444241.9915.750.11
454342.9915.330.11
464443.9916.050.12
474544.9917.250.12
484645.9919.40.13
494746.9921.30.13
504847.9922.850.14
514948.9922.780.14
525049.9922.580.15
535150.9922.420.16
545251.9920.810.16
555352.9918.540.17
565453.9916.740.17
575554.9915.540.18
585655.9915.910.18
595756.9918.060.19
605857.9920.10.19
615958.9921.850.2
626059.9923.320.2
636160.9924.280.21
646261.9924.590.22
656362.9924.810.22
666463.9924.970.23
67656524.370.24
68666624.380.24
69676724.680.25
70686824.70.26
71696924.60.27
72707024.510.27
73717124.50.28
74727225.060.29
75737325.550.29
76747425.590.3
77757525.280.31
78767624.780.31
79777725.060.32
80787825.310.33
81797925.980.33
82808025.810.34
83818125.660.35
84828226.010.36
85838326.720.36
86848427.530.37
87858528.550.38
88868629.270.39
89878729.720.4
90888829.980.4
91898930.250.41
92909030.560.42
93919130.560.43
94929230.410.44
95939330.280.45
96949430.20.45
97959530.20.46
98969630.690.47
99979730.10.48
100989829.690.49
101999929.290.5
10210010029.760.5
10310110130.330.51
10410210230.670.52
10510310330.750.53
10610410430.850.54
10710510530.770.55
10810610630.110.56
10910710729.70.56
11010810829.860.57
11110910930.120.58
11211011030.760.59
11311111131.130.6
11411211231.850.61
11511311332.120.61
11611411432.310.62
11711511531.970.63
11811611631.420.64
11911711728.120.65
12011811824.540.66
12111911921.240.66
12212012018.240.67
12312112114.650.67
12412212211.990.68
1251231239.070.68
1261241246.630.68
12712512530.68
1281261261.440.68
1291271271.10.68
13012812800.68
131129128.9900.68
132130129.9900.68
133131130.9900.68
134132131.9900.68
135133132.9900.68
136134133.9900.68
137135134.9900.68
138136135.9900.68
139137136.9900.68
140138137.9900.68
141139138.9900.68
142140139.9900.68
143141140.9900.68
144142141.9900.68
145143142.9900.68
146144143.9900.68
147145144.9900.68
148146145.9900.68
149147146.9900.68
150148147.9900.68
151149148.9900.68
152150149.9900.68
153151150.9900.68
154152151.9900.68
155153152.9900.68
156154153.9900.68
157155154.9900.68
158156155.9900.68
159157156.9900.68
160158157.9900.68
161159158.9900.68
162160159.9900.68
163161160.9900.68
164162161.9900.68
165163162.9900.68
166164163.9900.68
167165164.9900.68
168166165.9900.68
169167166.999.760.69
170168167.9913.580.69
171169168.9917.110.69
172170169.9920.230.7
173171170.9922.430.7
174172171.9924.520.71
175173172.9925.920.72
176174173.9926.390.73
177175174.9925.380.73
178176175.9925.010.74
179177176.9924.570.75
180178177.9925.040.75
181179178.9925.110.76
182180179.9925.390.77
183181180.9925.750.77
184182181.9927.250.78
185183182.9926.120.79
186184183.9923.690.8
187185184.9922.230.8
188186185.9919.850.81
189187186.9917.520.81
190188187.9915.630.82
191189188.9919.120.82
192190189.9918.110.83
193191190.9920.420.83
194192191.9922.380.84
195193192.9924.750.85
196194193.9927.630.85
197195194.9930.830.86
198196195.9933.640.87
199197196.9936.260.88
200198197.9937.330.89
201199198.9939.360.9
202200199.9940.490.91
Sheet1
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
This should work on everything except your first cell. But, you may be able to augment the formula to include that:
(subsequent edit: it also gets all occurances, so maybe not the best for you. It also requires a helper column.).
Mr excel questions 63.xlsm
ABCDE
1unitunitunitunit
21117.210.01
32213.460.01FALSE
432.999.080.01FALSE
543.994.920.01FALSE
654.992.640.01FALSE
765.9900.01TRUE
876.9900.01TRUE
987.9900.01TRUE
1098.9900.01TRUE
11109.99465460.01TRUE
121110.993130.01FALSE
131211.9900.01FALSE
141312.990.01FALSE
151413.9946540.01FALSE
161514.9900.01TRUE
171615.9900.01TRUE
181717130.01TRUE
19181800.01FALSE
2019191230.01FALSE
21202000.01TRUE
22212100.01TRUE
23222200.01TRUE
24232300.01TRUE
2524248.980.02TRUE
26252511.660.02FALSE
27262614.910.02FALSE
28272717.120.03FALSE
29282817.160.03FALSE
30292918.310.04FALSE
xrockox
Cell Formulas
RangeFormula
E3:E30E3=OR( AND(C2:C3<>"",C2:C3=0), AND(C1:C2=0,E2=TRUE), AND(C3:C4<>"",C3:C4=0) )
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D3:D200Expression=OR( AND(C2:C3<>"",C2:C3=0), AND(C1:C2=0,E2=TRUE), AND(C3:C4<>"",C3:C4=0) )textNO
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

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