How can you do that with conditional formatting?

excelos

Well-known Member
Joined
Sep 25, 2011
Messages
591
Office Version
  1. 365
Platform
  1. Windows
Hello

I have a table and I want to conditionally format it.

I want to make red the cells that belong to the column of the cell of the top row that is after today's date and only if they are above zero.

Is there a way to do that? I tried to specify the top row but it does not seem to take it into account.

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Like this? Current date here is 9 October

Excel Workbook
CDEFGHI
107-Oct-1808-Oct-1809-Oct-1810-Oct-1811-Oct-1812-Oct-1813-Oct-18
20122100
30030323
410101
5133
600011
71321100
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C21. / Formula is =AND(C2>0,C$1>TODAY())Abc
 
Last edited:
Upvote 0
Like this? Current date here is 9 October

Excel Workbook
CDEFGHI
107-Oct-1808-Oct-1809-Oct-1810-Oct-1811-Oct-1812-Oct-1813-Oct-18
20122100
30030323
410101
5133
600011
71321100
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C21. / Formula is =AND(C2>0,C$1>TODAY())Abc

Thanks that's great.
But I noticed it's a bit trickier.

Can you do it mark as red the cells that extend beyond (to the right) the first cell that is larger than today's date AND is not zero? up to the end of the rows?
 
Upvote 0
Can you do it mark as red the cells that extend beyond (to the right) the first cell that is larger than today's date AND is not zero? up to the end of the rows?
I don't understand.

Can you show an example?
Or tell me which cells in my screen shot should be red, which ones should not and WHY?
 
Upvote 0
I don't understand.

Can you show an example?
Or tell me which cells in my screen shot should be red, which ones should not and WHY?

Yes sure.

Well, I want to mark red a specific range in each row.
It's a bit tricky.
The end cell of that range would be the last non zero cell where the date is past today.
The start cell of that range would be the first cell where the date is past today.

So, I suppose if the end cell does not exist, it shouldn't highlight anything.

It's so tricky, any idea?

So in your example, the cells between the red ones should also be filled with red!
 
Last edited:
Upvote 0
So in your example, the cells between the red ones should also be filled with red!
But you said (originally) to colour the cells "only if they are above zero"
Has that requirement changed?
If so, it would just mean colour all cells in all columns whose date is after today, wouldn't it?

Edit: Or do you mean just these extra cells in my post? H4, G5, H5, G6, H6
 
Last edited:
Upvote 0
Date here is now 10 October so I've changed the row 1 dates.

Excel Workbook
CDEFGHI
108-Oct-1809-Oct-1810-Oct-1811-Oct-1812-Oct-1813-Oct-1814-Oct-18
20122100
30030323
410101
5133
600011
71321100
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C21. / Formula is =AND(COUNTIF(C2:$I2,">0"),C$1>TODAY())Abc
 
Upvote 0
Date here is now 10 October so I've changed the row 1 dates.

Excel Workbook
CDEFGHI
108-Oct-1809-Oct-1810-Oct-1811-Oct-1812-Oct-1813-Oct-1814-Oct-18
20122100
30030323
410101
5133
600011
71321100
CF
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C21. / Formula is =AND(COUNTIF(C2:$I2,">0"),C$1>TODAY())Abc

Brilliant thank you! Can you explain the logic in english?
 
Upvote 0
Brilliant thank you! Can you explain the logic in english?
The formula just checks that the following 2 conditions are met. If so, the cell is formatted.
- the heading of the column is a date after TODAY()
- the cell itself, or any cell to the right of it, is greater than zero
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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