Тёмный

Conditionally format so the coloured cells can be counted in Excel 

Barb Henderson
Подписаться 36 тыс.
Просмотров 20 тыс.
50% 1

Conditionally format so the coloured cells can be counted in Excel. Use the correct type of conditional formatting so you are able to count. Free templates and templates with code are available for purchase for $50 USD
www.easyexcelanswers.com/temp...
For more help visit my website www.easyexcelanswers.com or email me at easyexcelanswers@gmail.com.
Contact me regarding customizing this template for your needs.
Click for online Excel Consulting www.calendly.com/easyexcelanswers
I am able to provide online help on your computer at a reasonable rate.
www.amazon.com/shop/barbhende...
I use a Blue condenser Microphone to record my videos, here is the link
amzn.to/37gyyGa
Check out Crowdcast for creating your webinars
app.linkmink.com/a/crowdcast/83
If you need to buy Office 2019 follow
amzn.to/2VX5dv8
I use Tube Buddy to help promote my videos
Check them out
www.Tubebuddy.com/easyexcelan...
Follow me on Facebook
/ easyexcel.answers
TWEET THIS VIDEO • Conditionally format s...
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
ru-vid.com_cs_p...
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I've used or have experience with.
Code
Function COUNTConditionColorCells(CellsRange As Range, ColorRng As Range)
'make the worksheet always update
Application.Volatile
'define my variables
Dim Work As Boolean
Dim dbw As String
Dim CFCELL As Range
Dim CF1 As Single
Dim CF2 As Double
Dim CF3 As Long
Work = False
'for the first conditional format to the number of conditions in the range
For CF1 = 1 To CellsRange.FormatConditions.Count
'if the first condition colour is in the range then start counting
If CellsRange.FormatConditions(CF1).Interior.ColorIndex = ColorRng.Interior.ColorIndex Then
Work = True
Exit For
End If
Next CF1
CF2 = 0
CF3 = 0
If Work = True Then
For Each CFCELL In CellsRange
'count the colours in the range
dbw = CFCELL.FormatConditions(CF1).Formula1
dbw = Application.ConvertFormula(dbw, xlA1, xlR1C1)
dbw = Application.ConvertFormula(dbw, xlR1C1, xlA1, , ActiveCell.Resize(CellsRange.Rows.Count, CellsRange.Columns.Count).Cells(CF3 + 1))
If Evaluate(dbw) = True Then CF2 = CF2 + 1
CF3 = CF3 + 1
Next CFCELL
Else
COUNTConditionColorCells = "NO-COLOR"
Exit Function
End If
COUNTConditionColorCells = CF2
End Function

Опубликовано:

 

14 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 73   
@antonislk2402
@antonislk2402 2 года назад
Best solution ever! Thank you Barb 🙏
@BarbHendersonconsulting
@BarbHendersonconsulting 2 года назад
Happy to help!
@sriwiyanti3143
@sriwiyanti3143 2 года назад
THANKS A LOT!!! Really love this
@BarbHendersonconsulting
@BarbHendersonconsulting 2 года назад
Glad you like it!
@sheldonstclair371
@sheldonstclair371 2 года назад
brilliant!! thanks - will try it out now.
@BarbHendersonconsulting
@BarbHendersonconsulting 2 года назад
Hope you enjoy it!
@mariauzcategui8755
@mariauzcategui8755 Год назад
THANK YOU so much!! everything worked! Had different cells colors from conditional formating, and count them all!. Do you have a similar example with adding conditional formatted cell colors?
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
I think this is what you want ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-DY_ieB9NEYY.html
@user-zj8np1yb6r
@user-zj8np1yb6r Год назад
hello Barb, thank you for this video, and How To sum Cells By Colors With Conditional Formatting In Excel
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
I will look at that I do not know if it is possible
@bowtie3978
@bowtie3978 Год назад
Thank you for this video!!! Is there a way to right it so that it counts the cells across the row rather than the column?
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
you select the range, it does not matter whether row or column
@user-id7ci6kl8k
@user-id7ci6kl8k Год назад
It works great on single format conditions. some of my cells have several conditional rules. is there a way to make this work for those? Thank you very much!
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
This one works better . It counts all coloured cells ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EG1OSW5cn7E.html
@georginarabail1863
@georginarabail1863 Год назад
Thank you for this presentation. The "COUNTConditionColorCells" function is not available on my Excel Office 365. Grateful would you help on this.
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
if you watch the entire video, you must install the code. The code is located in the description of this video.
@jonkpetro
@jonkpetro Год назад
I'm attempting to use the same formatting rules across multiple data sets in a sheet. I've configured the rules and formula to count correctly, but when attempting to use the =COUNTConditionColorCells on an additional, different range of cells (although with the same color) the totals only reflect the first data set, even though I've changed the range criteria. Is this a limitation or am I missing something?
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
I have never tried with multiple sheets but I believe it may be a limitation
@patrickkinbonso1809
@patrickkinbonso1809 Год назад
@@BarbHendersonconsulting do you mean the conditional formatting area needs to be in the same sheet as the formula?
@MikeDevola
@MikeDevola Год назад
Sorry, I think we have a miscommunication. I set my conditional formatting in columns but need to count the bad data across the rows. Your function works if the formatting range and the counting range of the data goes in the same direction (horizontally or vertically).
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
I do not know how to fix that!
@johnzdanewicz6982
@johnzdanewicz6982 Год назад
My Conditional format formula is (=AND(D2D1+1, D3D2+1), to check for non-consecutive numbers within that column range. But, what if you have a text heading in cell D1? Like "Record Number".
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
that is a tough one!
@julienrozes1531
@julienrozes1531 Год назад
Dear Barb, would it be possible that the COUNTConditionColorCells formula does not work when the condition format formula is not simple ? I tried with a simple formula as in your exemple and it worked but when I tried with a different conditional format formula ( Color red when =AND($D3 «» ;$E3=«») ) the COUNTConditionColorCells did not work anymore
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
good to know
@julienrozes1531
@julienrozes1531 Год назад
@@BarbHendersonconsulting would you have any idea how to make it work?
@1le0nard0
@1le0nard0 6 месяцев назад
In my case I did the conditional as a range But i have to count them horizontally and it doesn't work
@BarbHendersonconsulting
@BarbHendersonconsulting 6 месяцев назад
try this one ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EG1OSW5cn7E.html
@grandphilip2550
@grandphilip2550 Год назад
My data is horizon which has many rows. It looks like only the first row works to the expected result whike I try to get COUNTConditionColorCells applied to all rows with same conditional formatting. Any idea why it does not work? Thanks.
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
This one works better ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EG1OSW5cn7E.html
@dragonblade2665
@dragonblade2665 2 месяца назад
It works great for vertical but does not work for me for horizontal. Returns a valves error. Any way to fix this.
@BarbHendersonconsulting
@BarbHendersonconsulting 2 месяца назад
the code on this video works better ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ZCnfjCN0Mzs.html
@brookiieebabeess69
@brookiieebabeess69 11 месяцев назад
Hi. I was wondering if there was a way to make it only count a specific range of cells. Right now I have it counting all of column G. But if I select only from ex. G2-G25 it still finds all of column G. Is there something I am doing wrong?
@BarbHendersonconsulting
@BarbHendersonconsulting 11 месяцев назад
you should be able to select G2-G25! I would try it again.
@macsasmr6100
@macsasmr6100 Год назад
Can this be used with multiple colours ?
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
Yes absolutely
@jenniferbarela7229
@jenniferbarela7229 Год назад
This is very informative, thank you! However, I am having an issue....I do not see the CountConditionColorCells function. How do I get this added as an option to choose?
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
Watch the entire video. I have the code included in the description of the video and show you were to enter it
@jenniferbarela7229
@jenniferbarela7229 Год назад
I see that the code it above, But I am not sure how to add it
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
@@jenniferbarela7229 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AByFH0TN53M.html
@MikeDevola
@MikeDevola Год назад
This code works great, but I have my conditional formatting in columns but want to count the formatted cell across a row and it does not work. I need to confirm individual parts are correct and the data populates in rows with the different dimensions for each part in the columns.
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
Unfortunately this must be run every time the data is updated
@djwilliams100
@djwilliams100 10 месяцев назад
When a cell changes color due to the data changing, the VBA doesnt look like it refreshing. Im using Office 365 if that helps?
@BarbHendersonconsulting
@BarbHendersonconsulting 10 месяцев назад
I do not understand why it is not refreshing?
@Abbermist
@Abbermist 11 месяцев назад
I have been looking for this solution for some time. My only question is how do i get hold of your VBA code?
@BarbHendersonconsulting
@BarbHendersonconsulting 11 месяцев назад
the VBA code is located in the description of the video
@user-ei1wr4zp2d
@user-ei1wr4zp2d Год назад
When the colour changes in a cell of a row by condition formatting, this formula gives a result as wrong. But it works correctly when I have given one colour as the condition colour formatting. Please help me.
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
the conditional formatting is only concerned with the result of the formula in a cell.
@albertrosales2858
@albertrosales2858 2 года назад
:-( i dont have countConditionalColorCells ... how can activate that?
@BarbHendersonconsulting
@BarbHendersonconsulting 2 года назад
The code to install this function is located in the description of the video
@tbilderbac
@tbilderbac 2 года назад
I copied the code and put it in the Module and when I went to use it it says there is a compiling issue? I copied and pasted?
@BarbHendersonconsulting
@BarbHendersonconsulting 2 года назад
On the visual basic window, under tools, References I have Visual Basic for Applications, Microsoft Excel 16 Object library, OLE Automation and Microsoft office 16 object library check. Try this
@tbilderbac
@tbilderbac 2 года назад
@@BarbHendersonconsulting I have all of them checked also?
@anushkasingh9332
@anushkasingh9332 Год назад
Did you resolve it?
@simayozgur8760
@simayozgur8760 Год назад
I keep getting the value 0, any idea why?
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
if you follow the correct conditional formatting, I am not sure
@patrickkinbonso1809
@patrickkinbonso1809 Год назад
I have a column containing 3 different colours and your code seems to work only on red colour. Any idea why please?
@BarbHendersonconsulting
@BarbHendersonconsulting Год назад
are you selecting the different colours in different formula
@patrickkinbonso1809
@patrickkinbonso1809 Год назад
@@BarbHendersonconsulting yes I am
@patrickkinbonso1809
@patrickkinbonso1809 Год назад
@@BarbHendersonconsulting just an update that the Function VBA in part works .. but I have found something highly interesting .. based on multiple conditions, the code seems to give out incorrect counting .. visually say there are 20 red, 1 amber and 3 green when the count gives 19 red, 1 amber and 4 green .. I can assure you that all the coloured cells are based on conditional formatting ... any idea please would be appreciated. Thanks
@patrickkinbonso1809
@patrickkinbonso1809 Год назад
@@BarbHendersonconsulting does the VBA code count directly via the actual formulas in the list of Conditional Formatting or via the coloured outcomes of the conditional formatting please?
@macsasmr6100
@macsasmr6100 Год назад
@@patrickkinbonso1809 did you figure it out?
@nicolesamson380
@nicolesamson380 2 года назад
i get only "0", doesnt work, tried formatting just as you did also
@BarbHendersonconsulting
@BarbHendersonconsulting 2 года назад
go over the steps again, it seems to work for everyone else
@amsantos00
@amsantos00 3 месяца назад
It didn't work for me. it shows NO-COLOR or wrong value
@BarbHendersonconsulting
@BarbHendersonconsulting 3 месяца назад
Try this one ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EG1OSW5cn7E.html I have better luck with this one
@amsantos00
@amsantos00 3 месяца назад
@@BarbHendersonconsulting it doesn't update though every time there is a new conditionally formatted cells.
@jalilalbawi4216
@jalilalbawi4216 2 года назад
I get NO-COLOR after count
@BarbHendersonconsulting
@BarbHendersonconsulting 2 года назад
go over you steps again, it does work
@anushkasingh9332
@anushkasingh9332 Год назад
Did you resolve it?
@ahmedabdulkarim250
@ahmedabdulkarim250 7 месяцев назад
NO-COLOR
@BarbHendersonconsulting
@BarbHendersonconsulting 7 месяцев назад
try again!
Далее
SUM and COUNT by Cell Colour in Excel -- WITHOUT VBA!
16:32
Excel Conditional Formatting using Formulas
9:23
Просмотров 292 тыс.
skibidi toilet multiverse 039 (part 2)
08:58
Просмотров 4,5 млн
다리에 힘이 풀려버린 슈슈 (NG Ver.)
00:11
Просмотров 1,8 млн
Sum Cells Based on Their Color in Excel (Formula & VBA)
12:18
Learn How to Count Cells by Color in Microsoft Excel
6:33