conditional formatting for rows with blank cells

mbnott

New Member
Joined
Aug 1, 2024
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
My spreadsheet has data in columns A:AD. I already have a CF rule to highlight blank cells, but due to the size of the sheet, it can be hard to visually catch all of them. So, I want a CF rule to highlight the cell in column A if that cell contains data and any of the cells in C:AD have any left blank.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Your Conditional Formatting formula would look something like this for cell A1:
Excel Formula:
=AND($A1<>"",COUNTBLANK($C1:$AD1)>0)
You would just select column A and apply this CF formula, and choose your desired formatting.
 
Upvote 1
Solution
Your Conditional Formatting formula would look something like this for cell A1:
Excel Formula:
=AND($A1<>"",COUNTBLANK($C1:$AD1)>0)
You would just select column A and apply this CF formula, and choose your desired formatting.
That worked perfectly, thank you! Secondary question...I had another CF rule to just highlight all blank cells. Naturally, this highlights every row even below my data. How can I highlight blank cells only if data is entered into column A? Basically, if I entered a date into column A like I'm starting an entry, but then any cell from B:AD gets left blank then those blank cells are highlighted to show me that something is missing.
 
Upvote 0
So, you could select columns B:AD, and enter this Conditional Formatting formula:
Excel Formula:
=AND($A1<>"",B1="")
Note how the column A reference is locked down to column A, so every cell looks at column A to see if there is a value.
But the column B reference "floats", so column B looks at the entry in column B, column C looks at the entry in column C, etc.
 
Upvote 1
So, you could select columns B:AD, and enter this Conditional Formatting formula:
Excel Formula:
=AND($A1<>"",B1="")
Note how the column A reference is locked down to column A, so every cell looks at column A to see if there is a value.
But the column B reference "floats", so column B looks at the entry in column B, column C looks at the entry in column C, etc.
That didn't quite work right. I don't think I explained it quite right. The only dependency should be on whether data is in A. Then look at each adjacent cell independently to highlight if it is left blank. No different than the 'highlight blank cells' basic rule, but do that only if something is in A. This way, if I overlook entering into any of those adjacent cells then those specific cells would be highlighted.
 
Upvote 0
That didn't quite work right. I don't think I explained it quite right. The only dependency should be on whether data is in A. Then look at each adjacent cell independently to highlight if it is left blank. No different than the 'highlight blank cells' basic rule, but do that only if something is in A. This way, if I overlook entering into any of those adjacent cells then those specific cells would be highlighted.
I still think what I posted does that.
What range exactly did you select before entering that formula?
And did you remove any previous Conditional Formatting that you may already have on these cells which could be interfering with it?

If it still does not work out, I think it would be very beneficial to visually post a small example of your data and exactly what you want to happen.
You know the old saying, "a picture says a thousand words".
 
Upvote 1
I still think what I posted does that.
What range exactly did you select before entering that formula?
And did you remove any previous Conditional Formatting that you may already have on these cells which could be interfering with it?

If it still does not work out, I think it would be very beneficial to visually post a small example of your data and exactly what you want to happen.
You know the old saying, "a picture says a thousand words".
I deleted the original 'highlight blank cells' rule, yes. The rule is exactly as you typed it, but I just changed the number from 1 to 2. What have I done wrong?
Capture1.JPG


Capture2.jpg
 
Upvote 0
The formula you enter has to exactly coincide with the range it is being applied to.
The formula always applies to the VERY first cell in your selected range.

If you select an ENTIRE column, row 1 will ALWAYS be the first row in that range.
So you need to write the formula as it pertains to row 1.

Otherwise, if you select the whole column, but write your formula looking at row 2, then row 1 of the conditional formatting will look at the values in row 2, and row 2 of the conditional formatting will look at the values in row 3, etc. So you will always be shifted off by one row.

So you have two options here if you want it to start in row 2:
1. Do NOT select the whole column. Select your specific range, starting with row 2.
2. If you want to select the entire column, you will need to write your formula to look at the values in row 1. But if you want to actually exclude row 1 from this (even though it is in your selected range, you can add an AND condition like this:
Rich (BB code):
=AND($A1<>"",B1="",ROW()<>1)
so we are just adding one more condition that says that the row is not row 1.

Pick whichever method serves you best.
 
Upvote 1
The formula you enter has to exactly coincide with the range it is being applied to.
The formula always applies to the VERY first cell in your selected range.

If you select an ENTIRE column, row 1 will ALWAYS be the first row in that range.
So you need to write the formula as it pertains to row 1.

Otherwise, if you select the whole column, but write your formula looking at row 2, then row 1 of the conditional formatting will look at the values in row 2, and row 2 of the conditional formatting will look at the values in row 3, etc. So you will always be shifted off by one row.

So you have two options here if you want it to start in row 2:
1. Do NOT select the whole column. Select your specific range, starting with row 2.
2. If you want to select the entire column, you will need to write your formula to look at the values in row 1. But if you want to actually exclude row 1 from this (even though it is in your selected range, you can add an AND condition like this:
Rich (BB code):
=AND($A1<>"",B1="",ROW()<>1)
so we are just adding one more condition that says that the row is not row 1.

Pick whichever method serves you best.
Ahh. Ok. I got it now. Thank you so much for all of your help! You made my day so much easier!
 
Upvote 0
You are welcome.

That is a very common mistake. People want to apply Conditional Formatting to entire column, except for a header row.
They select the entire column, but write the formula as it applies to row 2.
So now their Conditional Formatting is now shifted off one row!
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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