How do you highlight an entire row if all values are the same

LeighDIFonzo

New Member
Joined
Feb 16, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have a large spreadsheet, and have 24 specific columns with values starting at 0. I need to highlight the entire row if all 24 columns have a value of 0. There has to be a way to do this... I don't need to highlight the row if any of the 24 columns has a value other than 0.
 

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.
Try this:


Book1
ABCDEFGHIJKLMNOPQRSTUVWX
1
2TRUE
3
4000000000000000000000000
5000000000000011111111111
6000000000000000000000000
Sheet9
Cell Formulas
RangeFormula
A2A2=SUM(--($A4:$X4=0))=24
A4:X4A4=SEQUENCE(1,24,0,0)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4:X6Expression=SUM(--(A4:X4=0))=24textNO
 
Upvote 0
Try this:


Book1
ABCDEFGHIJKLMNOPQRSTUVWX
1
2TRUE
3
4000000000000000000000000
5000000000000011111111111
6000000000000000000000000
Sheet9
Cell Formulas
RangeFormula
A2A2=SUM(--($A4:$X4=0))=24
A4:X4A4=SEQUENCE(1,24,0,0)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4:X6Expression=SUM(--(A4:X4=0))=24textNO
I should have mentioned I have 1100+ lines of data, would I do this as conditional formatting or is there a formula?
 
Upvote 0
I conditionally formatted the first row,
Then Copied the formatting over all the rows (including the first row).
 
Upvote 1
Welcome to the MrExcel board!

I'm not sure just what your data could be like but I don't think the the above suggestion is robust.

Here is that CF formula with some different sample data.
  • All row 5 is formatted when not all values are zero.
  • Much of row 7 is not formatted even though all 24 values are zero.
  • Some of row 8 is formatted even though not all 24 values are zero.
24 02 18.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZ
4000000000000000000000000
500
6000000000000000000000000
700000000000000000000000033
8000000000000000000022000
CF1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
Z7,A4:X8Expression=SUM(--(A4:X4=0))=24textNO


The rows 7 & 8 issues would be resolved if $ signs were used in the CF formula but the row 5 issue would remain.

24 02 18.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZ
4000000000000000000000000
500
6000000000000000000000000
700000000000000000000000033
8000000000000000000022000
CF2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4:X8Expression=SUM(--($A4:$X4=0))=24textNO


I would use this to be more robust

24 02 18.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZ
4000000000000000000000000
500
6000000000000000000000000
700000000000000000000000033
8000000000000000000022000
CF3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4:X8Expression=COUNTIF($A4:$X4,0)=24textNO
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,977
Members
449,095
Latest member
Mr Hughes

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