Is There a Way to count Cell Background Color under Each Column Without Filtering

andyka

Board Regular
Joined
Sep 20, 2021
Messages
52
Office Version
  1. 2019
Platform
  1. Windows
Hi Experts
Is there a way to count How many Cells are Green, Amber and Blue above each Column without filtering the Data.
Please ignore Dates as some will not have dates. I just want to count the colors above each column.
Having VBA is ok However, formula would be better if possible

Gantt with dates.xlsx
ABCDEFGHIJKLMNOPQR
1KEYNot Started121
2InProgress255444432111
3Completed222
4Activity NameStartFinishActivity StatusOct-21Nov-21Dec-21Jan-22Feb-22Mar-22Apr-22May-22Jun-22Jul-22Aug-22Sep-22Oct-22Nov-22
5 29-Oct-21              
6 10670.5.11 OST - P1              
7 SG 0 - TRA (10%)02/10/2129/11/21Not Started02/10/2129/11/21            
8 Stage Gate 0 Complete29/11/21InProgress 29/11/21            
9 Start Definition Phase12/10/21Completed12/10/21             
10 10670.5.12 OST - P2              
11 SG 0 - TRA (10%)14/10/2129/12/21InProgress14/10/21 29/12/21           
12 Stage Gate 0 Complete29/11/21Not Started 29/11/21            
13 Stage Gate 1 Approved29/12/21Not Started  29/12/21           
14 Summary - Concept (Planning Package)22/12/2120/02/22Not Started  22/12/21 20/02/22         
15 SG0 to SG1 LOE18/11/2115/04/22Not Started 18/11/21    15/04/22       
16 10670.5.15 OST - 07              
17 Receive Expression of Interest from AWE Sponsor29/10/21Completed29/10/21             
18 Start18/12/21Completed  18/12/21           
19 02-Nov-21              
20 10670.5.12 OST - P2              
21 Update Risk Register14/11/2102/09/22Not Started 14/11/21         02/09/22  
22 Update MDAL28/03/2202/05/22Not Started     28/03/22 02/05/22      
23 04-Nov-21              
24 10670.5.12 OST - P2              
25 Risk Register Review23/10/2104/06/22Not Started23/10/21       04/06/22     
26
27
Sheet1 (2)
Cell Formulas
RangeFormula
E5:R25E5=IFERROR(IFS(DATE(YEAR($B5),MONTH($B5),1)=E$4,$B5,DATE(YEAR($C5),MONTH($C5),1)=E$4,$C5),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E5:R25Expression=AND($D5=$B$2,IFS(AND($B5<>"",$C5<>""),AND(E$4>=DATE(YEAR($B5),MONTH($B5),1),E$4<=DATE(YEAR($C5),MONTH($C5),1)),AND($B5="",$C5=""),"",OR($B5="",$C5=""),IF(DATE(YEAR(MAX($B5,$C5)),MONTH(MAX($B5,$C5)),DAY(1))=E$4,TRUE)))textNO
E5:R25Expression=AND($D5=$B$3,IFS(AND($B5<>"",$C5<>""),AND(E$4>=DATE(YEAR($B5),MONTH($B5),1),E$4<=DATE(YEAR($C5),MONTH($C5),1)),AND($B5="",$C5=""),"",OR($B5="",$C5=""),IF(DATE(YEAR(MAX($B5,$C5)),MONTH(MAX($B5,$C5)),DAY(1))=E$4,TRUE)))textNO
E5:R25Expression=AND($D5=$B$1,IFS(AND($B5<>"",$C5<>""),AND(E$4>=DATE(YEAR($B5),MONTH($B5),1),E$4<=DATE(YEAR($C5),MONTH($C5),1)),AND($B5="",$C5=""),"",OR($B5="",$C5=""),IF(DATE(YEAR(MAX($B5,$C5)),MONTH(MAX($B5,$C5)),DAY(1))=E$4,TRUE)))textNO
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
what does that mean, put 3 count values in row one from E to P (or whatever)? I think you should show the desired result.
Hi Micron
The desired results are already shown in cell E1 to P3
I just want the colors to be counted above each column as shown between E1 to P3.
for example: In column E I have data between E5 to E25 and there are 1 orange, 2 green 2 blue. I color coded them wrong in sheet. But I want E1 to P3 to be automatically color coded for the color shown in column for example there is only Blue color in Column H5 to H25 so the resultant value only should show 4 in H1
I hope is was helpful.
Thank you in advance
 
Upvote 0
Updates sheet
Gantt with dates.xlsx
ABCDEFGHIJKLMNOPQRSTUV
1KEYNot StartedDesire Results-->255444432111
2InProgressDesire Results-->121
3CompletedDesire Results-->222
4Activity NameStartFinishActivity StatusOct-21Nov-21Dec-21Jan-22Feb-22Mar-22Apr-22May-22Jun-22Jul-22Aug-22Sep-22Oct-22Nov-22
5 29-Oct-21              
6 10670.5.11 OST - P1              
7 SG 0 - TRA (10%)02/10/2129/11/21Not Started02/10/2129/11/21            
8 Stage Gate 0 Complete29/11/21InProgress 29/11/21            
9 Start Definition Phase12/10/21Completed12/10/21             
10 10670.5.12 OST - P2              
11 SG 0 - TRA (10%)14/10/2129/12/21InProgress14/10/21 29/12/21           
12 Stage Gate 0 Complete29/11/21Not Started 29/11/21            
13 Stage Gate 1 Approved29/12/21Not Started  29/12/21           
14 Summary - Concept (Planning Package)22/12/2120/02/22Not Started  22/12/21 20/02/22         
15 SG0 to SG1 LOE18/11/2115/04/22Not Started 18/11/21    15/04/22       
16 10670.5.15 OST - 07              
17 Receive Expression of Interest from AWE Sponsor29/10/21Completed29/10/21             
18 Start18/12/21Completed  18/12/21           
19 02-Nov-21              
20 10670.5.12 OST - P2              
21 Update Risk Register14/11/2102/09/22Not Started 14/11/21         02/09/22  
22 Update MDAL28/03/2202/05/22Not Started     28/03/22 02/05/22      
23 04-Nov-21              
24 10670.5.12 OST - P2              
25 Risk Register Review23/10/2104/06/22Not Started23/10/21       04/06/22     
26
27
28
Sheet1 (2)
Cell Formulas
RangeFormula
E5:R25E5=IFERROR(IFS(DATE(YEAR($B5),MONTH($B5),1)=E$4,$B5,DATE(YEAR($C5),MONTH($C5),1)=E$4,$C5),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E5:R25Expression=AND($D5=$B$2,IFS(AND($B5<>"",$C5<>""),AND(E$4>=DATE(YEAR($B5),MONTH($B5),1),E$4<=DATE(YEAR($C5),MONTH($C5),1)),AND($B5="",$C5=""),"",OR($B5="",$C5=""),IF(DATE(YEAR(MAX($B5,$C5)),MONTH(MAX($B5,$C5)),DAY(1))=E$4,TRUE)))textNO
E5:R25Expression=AND($D5=$B$3,IFS(AND($B5<>"",$C5<>""),AND(E$4>=DATE(YEAR($B5),MONTH($B5),1),E$4<=DATE(YEAR($C5),MONTH($C5),1)),AND($B5="",$C5=""),"",OR($B5="",$C5=""),IF(DATE(YEAR(MAX($B5,$C5)),MONTH(MAX($B5,$C5)),DAY(1))=E$4,TRUE)))textNO
E5:R25Expression=AND($D5=$B$1,IFS(AND($B5<>"",$C5<>""),AND(E$4>=DATE(YEAR($B5),MONTH($B5),1),E$4<=DATE(YEAR($C5),MONTH($C5),1)),AND($B5="",$C5=""),"",OR($B5="",$C5=""),IF(DATE(YEAR(MAX($B5,$C5)),MONTH(MAX($B5,$C5)),DAY(1))=E$4,TRUE)))textNO
 
Upvote 0
I didn't see the scroll bar and thought you posted a section several rows down. My bad. :eek:
If there is a formula for this I'll never be able to provide it as they're not my thing. Should be doable with code though. Want to wait for a formula?
 
Upvote 0
I didn't see the scroll bar and thought you posted a section several rows down. My bad. :eek:
If there is a formula for this I'll never be able to provide it as they're not my thing. Should be doable with code though. Want to wait for a formula?
Hi Micron

Although, I would love to know formula as its a challenging post but please provide VBA if possible.
 
Upvote 0
I'll see what I can do. I'm much better at Access vba so this will take a bit of time.
 
Upvote 0
After an hour or so I've decided there is no such thing as UsedRange for a column unless one creates a function for that. So a key element, as far as I'm concerned: if any cell is coloured below the last row that contains data in col A, it is of no consequence? In other words, A25 is the last A row with data. If someone coloured E30, it should be ignored because it comes after A25.
 
Upvote 0
Hi Micron

I actually have data in column E5:AR675

So, is the solution possible?

I just wants to know how many blue,green,Amber cells are under each column without filtering data but although I will be using filter to filter data for other purposes such as project id, dates etc..
 
Upvote 0
What I'm asking is if col A defines the last row with data (the last row of concern), and if there's any cell coloured anywhere below that row, it doesn't matter.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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