Highlight subtotal

cweaver

New Member
Joined
Jan 20, 2006
Messages
21
Office Version
  1. 365
Platform
  1. MacOS
Is there some way to also highlight the subtotal roll-up Total row, so that I don't have to expand the selection to see the green color?

The excel sheet is subtotaled by customer.

This is the formula being used to highlight rows in green:
=AND($D2<>"",YEAR($D2)<2023,COUNTIFS($A$2:$A$9002,$A2,$D$2:$D$9002,">="&DATEVALUE("1/1/2023"))=0)

Screenshot 2023-09-15 at 2.27.43 PM.png
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
This is the formula being used to highlight rows in green:
=AND($D2<>"",YEAR($D2)<2023,COUNTIFS($A$2:$A$9002,$A2,$D$2:$D$9002,">="&DATEVALUE("1/1/2023"))=0)
That is dependant on the date in column D. Since the subtotalled row does not have a date in column D, how would you determine whether of not to highlight the subtotalled row?
 
Upvote 0
Is there a modification to the this formula that could could be made:

=AND($D2<>"",YEAR($D2)<2023,COUNTIFS($A$2:$A$9002,$A2,$D$2:$D$9002,">="&DATEVALUE("1/1/2023"))=0)

...the modification would take into account the following:

If the formula is TRUE (and the cells are highlighted in green), then the row above those cells highlighted in green that contain "*** Total" should also be highlighted.

Does that make sense?
 
Upvote 0
Does this do what you want?

cweaver.xlsm
ABCD
1NameHdr2Hdr3Hdr4
2Grand Total
3a Total
4a3/03/2022
5a3/03/2023
6a8/08/2024
7b Total
8b5/07/2023
9b6/06/2022
10c Total
11c1617/05/2022
12c2715/08/2021
13c384/04/2021
14c498/07/2021
15c51018/05/2022
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:D15Expression=AND(IF(RIGHT($A2,5)="Total",$D3,$D2)<>"",YEAR($D2)<2023,COUNTIFS($A$2:$A$9002,IF(RIGHT($A2,5)="Total",$A3,$A2),$D$2:$D$9002,">="&DATEVALUE("1/1/2023"))=0)textNO


When collapsed:

1694945620469.png
 
Upvote 1
Solution
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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