How To Count Colors with an Excel Function | Count Colored Cells

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024
  • In this Excel video tutorial, I'll show you how to make an Excel function to count colors in Excel.
    If you have a table, a spreadsheet, where you colored your cells, you can count the colors with this formula that I'm going to show you.
    So, for example, in an accounts payable spreadsheet, you painted all overdue accounts yellow and now you need to know how many overdue accounts, yellow cells, you have in your table. With this color counting function in Excel, you will be able to do this math.
    To create this function in Excel, we will use Excel's Visual Basic Application or VBA.
    Function COUNT_COLOR(RANGE As Range, COLOR As Range)
    Dim COLORC As Integer
    Dim COUNTT As Integer
    COLORC = COLOR.Interior.ColorIndex
    Set IC = RANGE
    For Each IC In RANGE
    If IC.Interior.ColorIndex = COLORC Then
    COUNTT = COUNTT + 1
    End If
    Next IC
    COUNT_COLOR = COUNTT
    End Function
    #JopaExcel #Dashboard #Excel

Комментарии • 214

  • @user-yd1bo8ic9j
    @user-yd1bo8ic9j 9 месяцев назад +6

    Hi i've use the method you show and it works🎉🎉🎉
    But 1 issue i found is after i save the file as macro-enable worksheet the formulas did not automatically update i have to double click the formular cell in order for it to recalculated

    • @user-yd1bo8ic9j
      @user-yd1bo8ic9j 9 месяцев назад +1

      F9 did not work

    • @d4ve19
      @d4ve19 4 месяца назад

      @@user-yd1bo8ic9j not ideal but I've found that if you copy and paste colours already on the sheet to populate new colours, the count will update straight away.

  • @meowmeow1733
    @meowmeow1733 8 месяцев назад +1

    🎉🎉🎉🎉🎉🥳🥳🥳🥳🥳
    Thank you.
    After trying chat GPT👎, Google 👎, and one other video.....YOU...you are the first person/video to show me a solution that works. Thank you.
    Chapt gpt's not taking anyone's job in excel this year. Yah, it's fancy, but who cares if it consistently spits out things that don't work.

    • @Allinone-sh6cj
      @Allinone-sh6cj 8 месяцев назад +1

      Just learn visual basic coding and you're good to go but its not easy you want more focus

  • @sophiagarcia-p2c
    @sophiagarcia-p2c День назад

    Thank you so much, nice tutorial

  • @suniyem1
    @suniyem1 11 месяцев назад +10

    Thanks for this valuable information... appreciated but how to make it automatically ? Each time color change then the count also change without pressing enter

    • @jasonf5659
      @jasonf5659 3 месяца назад

      I need this as well.

  • @isaacgarciarojas521
    @isaacgarciarojas521 3 месяца назад +3

    Thank you for the video! I would just add a line below the function declaration that states: Application.Volatile so the values returned by the function update as the spreadsheet changes.

    • @listenSONE9
      @listenSONE9 3 месяца назад

      Hey you're right, the formulas don't update automatically! Where do we add that line exactly?

  • @MargoBelyaeva
    @MargoBelyaeva 2 дня назад

    thank you so much! it helped me a lot

  • @franciscorosario5681
    @franciscorosario5681 Месяц назад

    a lots of year looking for this jack and you did it easy for us Bro. Thanks a lot for your time and explanation.

  • @edygless
    @edygless 5 месяцев назад +3

    Hello!
    Thank you for your help!!! This video helps me to solve a problem. But, How can I do the function to automatically update the count?

  • @mif4158
    @mif4158 13 дней назад

    Thank you! Easy and straight to the point

  • @thrpersonalaccount6898
    @thrpersonalaccount6898 4 месяца назад

    Thank you so much! There isn't much out there for Macs, so I didn't even know where to start (I've never created a UDF or Macro before in Excel). You made it so straight-forward. 🙂

    • @JopaExcel
      @JopaExcel  4 месяца назад

      Thanks for the feedback. I'm glad the video helped you. 😁

  • @richardkavanagh4751
    @richardkavanagh4751 7 месяцев назад +4

    Thank you for this. How do I get it to refresh automatically. It seems at the moment if I change a cell colour the count does not change,

    • @lealeite9101
      @lealeite9101 6 месяцев назад

      I have the same question...

  • @Va113n
    @Va113n Месяц назад

    Brilliant, works like a charm. I found that the formulae needs to be redone every time you open a new sheet. If there is a fix, kindly share.

  • @rishimuni07
    @rishimuni07 4 месяца назад +1

    Thanks for this. Very clear. To the point. Helped a lot!
    I just have one additional query, what can be done extra in the sheet, so that when I colour a cell as Green, the count of Green increase by +1?

  • @robertrussi8913
    @robertrussi8913 6 месяцев назад +1

    Excellent tutorial, straight to the point and easy to understand

    • @Intellectual_House
      @Intellectual_House 4 месяца назад

      it works for me but the function is not saved , like if i use another excel document I can't find it do you have the same problem

  • @lizgabbett9844
    @lizgabbett9844 3 месяца назад

    I'm so very grateful for this video! You have saved me hours of work. Thank you!

    • @JopaExcel
      @JopaExcel  3 месяца назад

      Glad it helped! 🙏👍

  • @billycen9501
    @billycen9501 4 месяца назад +1

    Do work John! This is 1x useful and easily digestible tutorial

  • @robbie_t1525
    @robbie_t1525 2 месяца назад +1

    This is great.....except......it doesn't seem to continue counting automatically. What I mean is, every time I put in a new entry in the coloured field, I then have to click on the count_colour function cell to bring up the edit panel and hit enter for the count to go up by one. Any ideas why that would be happening?

  • @user-kz3vw5jt6n
    @user-kz3vw5jt6n 8 месяцев назад +17

    Good formula, but it has one problem, if the color changes in the range, the count doesn't change automatically. so we need to again refresh the formula

    • @lymphhh
      @lymphhh 6 месяцев назад

      Is there a solution???

    • @conma3
      @conma3 6 месяцев назад

      I agree with you
      It is a problem need to be solved

    • @rfassberg
      @rfassberg 6 месяцев назад

      It is a limitation of how Excel processes VBA functions.

    • @BCOzSportsGamer
      @BCOzSportsGamer 3 месяца назад

      Found a way. You can create a macro. For me, I have 4 cells I want to update the counts for. Record Macro > name macro > ok > click in each cell that you have the count_color formula in, once at a time, and enter at each of them. Then stop macro recording, insert a button form control and assign to the macro.

    • @coatedlamb2061
      @coatedlamb2061 Месяц назад

      ​@@BCOzSportsGamer For anyone else that got confused by this, what he says is CORRECT, just make sure to click on the "=COUNT_COLOR" in the text box just underneath the ribbon

  • @HcV82
    @HcV82 Месяц назад

    You rock buddy! Straight to the point! Thank you!

  • @SkiShorts777
    @SkiShorts777 5 месяцев назад

    Very useful, couldn't find anyone else who explains this so clearly!

  • @AA-nj2ni
    @AA-nj2ni 7 месяцев назад +3

    It doesn't work for my table of conditionally formatted colored cells. So i have a large set of number which are highlighted green whenever they are equal a certain number. I wanted the formula to count the highlighted conditionally highlighted cells when they change. This only works when the cells are manually colored.. do you know how to solve this for me please.
    🙏

  • @kristycarlson1042
    @kristycarlson1042 Год назад +3

    You just saved me so much time - THANK YOU for this!!

    • @JopaExcel
      @JopaExcel  11 месяцев назад

      I'm glad you liked it! Thank you 🙏👍

  • @liamhowlett1572
    @liamhowlett1572 3 месяца назад

    Thankyou for this, i have an issue however, i have to reapply the formula in the cell for the number to update, it doesnt update automatically. Even though I have the Calculation options set to automatic, any help?

  • @razvancarp7999
    @razvancarp7999 7 месяцев назад +1

    love you bro. I was searching for it and found nothing useful until I saw your video. You are the best! ;)

  • @monciak3001
    @monciak3001 8 месяцев назад +2

    Perfect! U are the best 😊 One more thing I need. How can I do autorefresh outcome after I change number of colours? 😎

  • @anabelaferro4933
    @anabelaferro4933 9 месяцев назад +4

    Your tutorial has been a life saver! Thanks!

  • @ruturajjadhav6137
    @ruturajjadhav6137 5 месяцев назад

    Thank You, Very Good explanation. Looking Forward for other formulae,
    One thing I would like to add, it also counts the merged cells. Where as it should give a whole count for all the cells.
    I hope you would add the change and make a video

  • @irshduck
    @irshduck 5 месяцев назад

    Just another RUclips HERO! Thank you!!

    • @irshduck
      @irshduck 5 месяцев назад

      Doesnt seem to pick up on formatted cell colors. Still troubleshooting

  • @CJT1869
    @CJT1869 9 месяцев назад +2

    Thank you so much for this, so very helpful. One question, when I change a cell to the color that I'm counting, how do i get the function to automatically update? I keep having to go the the function in the bar and hit enter for it to update.

    • @JopaExcel
      @JopaExcel  9 месяцев назад

      I'm very happy that the video helped you and thanks for the question.
      Try to use the shortcut key F9, maybe it will be able to update the sheet without you having to click in the cell and then click out. At least, it's faster to just hit the F9.

    • @vaikas1982
      @vaikas1982 8 месяцев назад +3

      @@JopaExcel F9 not update for me :(

  • @elankoko
    @elankoko 2 месяца назад

    Thank you so much. You made it so simple and easy.😊

    • @JopaExcel
      @JopaExcel  2 месяца назад

      Glad it helped! 🙏👍

  • @user-eq8hg5vr5s
    @user-eq8hg5vr5s 5 месяцев назад

    Thank you very much for the simple explanation and valuable information.

  • @makingmemories8373
    @makingmemories8373 5 месяцев назад

    Thank you sooo much. You're a Savior...

  • @edamerdna
    @edamerdna 6 дней назад

    thanks for sharing...

  • @dhaffirm1
    @dhaffirm1 Месяц назад

    So helpful, thank you!

  • @chikaka3170
    @chikaka3170 2 месяца назад

    Very nice tutorial. Just wondering if it is possible to automatically refresh the count as I would like to change color let's say in one of the cells?

  • @journeyoflife5740
    @journeyoflife5740 15 дней назад +1

    When there is an character on the cell, it doesn't count.
    How to get this done.?
    Please help

  • @reenurenjith1529
    @reenurenjith1529 Месяц назад

    hi, thank you so much. pls update on how to write a function to count adjacent cells with same colors. if two adjacent cells(eg: C1,D1) are having same color green, need to increment count by one. if two adjacent cells are of different color green and yellow, the count doesn't increment. pls help on the same.

  • @brianhammer8968
    @brianhammer8968 9 дней назад

    Is it possible to count the color if the cells have multiple conditional formatting rules? It only works when I delete the number and then make the square the color but then I have no value in the cell.

  • @AaronTrumble-l9h
    @AaronTrumble-l9h Месяц назад

    thankyou, this is wonderful. however today when opening the file I get#name error. Any ideas why? it was working perfectly

  • @AnasTeriZenki
    @AnasTeriZenki Год назад +2

    Thanks for the tutorial, very helpful in my work 😊

  • @CJFlowVibes
    @CJFlowVibes 9 месяцев назад

    it's work 100%, straight to the point and yea big thanks guy

  • @jeanmariecovoza2573
    @jeanmariecovoza2573 5 месяцев назад

    Thank you so much, so happy that i dropped your vedio.. very helpful

  • @johnnybegood3124
    @johnnybegood3124 4 месяца назад

    Thank you for this information.. It worked PERFECTLY...

  • @qpappa318
    @qpappa318 2 месяца назад

    Great video, what if I wanted to count the number of colored cells regardless of the unique color in a column? For example, I have a column with 8 different colored cells in it and I want a formula to just show me how many cells in that column have any color.

  • @kettah
    @kettah Месяц назад

    Fantastic! Thanks.

  • @ghostcon
    @ghostcon 3 месяца назад

    Exactly what i needed thanks!

    • @JopaExcel
      @JopaExcel  3 месяца назад

      Glad it helped! 🙏👍

  • @deedeealltheway1
    @deedeealltheway1 8 месяцев назад

    PERFECT!!!! THANK YOU SO MUCH FOR YOUR TUTORIAL

    • @JopaExcel
      @JopaExcel  8 месяцев назад

      Glad it helped! Thank you 😁🙏👍

  • @PerfectPetz3234-wm7xj
    @PerfectPetz3234-wm7xj 4 месяца назад

    Thank you so much for this!

  • @arsyanandregate7288
    @arsyanandregate7288 5 месяцев назад

    what a useful function, thank you man

  • @user-pg4hh4kd4t
    @user-pg4hh4kd4t Год назад +4

    Thank you for this video. I am working within a table and my counts are correct for the current set up, but the counts are not adjusting if I make edits to the colors (such as highlighting an additional cell). Here is my formula: =COUNT_COLOR(Table1[Person],C203). Can you tell me what I am doing wrong?

    • @JopaExcel
      @JopaExcel  Год назад +1

      Did you do the same as the video? Maybe is the formulas/functions in your spreadsheet are not automatically update. Check this, please. Maybe it can solve the problem.
      To check Calculation Settings: Click on the "Formulas" tab in the Excel ribbon and then, "Calculation". Calculation mode needs to be set as Automatic.
      Hope this can help you.

    • @felipecastruita7955
      @felipecastruita7955 10 месяцев назад +4

      I have the same issue and the calculate mode is set as automatic @@JopaExcel , do you know what could be wrong?
      I did the same as the video.

  • @muralidaranm343
    @muralidaranm343 День назад

    Which one we have to copy and paste

  • @Smurphyyy
    @Smurphyyy 6 месяцев назад +2

    Doesn't work, i permanently get the error that if i put an "=" at the start i need some kind of result or whatever

  • @BeatriceMihaelaPanduru
    @BeatriceMihaelaPanduru 4 месяца назад

    This is amazing, thank you so much!

  • @Rainstorm121
    @Rainstorm121 14 дней назад

    thank you. how can you count all the coloured cells? Note that these are empty cells.

  • @AshokKumar-hd7pz
    @AshokKumar-hd7pz 4 месяца назад

    Hello Jopa I am great fan of yours and learned lot of excel formulas by seeing your vedios now i need a help hope you would help me in our office we have a daily tracker in that we have 12 agents and works in 24/7 shifts we work on incident tickets as soon as the ticket arrives we have enter the ticket number in that sheet and change the color of the cell manually according to the time the ticket arrived for eg. if ticket came in between 8am to 9 am it will be green if it is between 9 am to 10 am then red if it is between 10 am to 11 am then purple so on so instead of changing the color manually i need a formula or a steps so based on current time when the data entered into a cell the color should change please suggest

  • @akshaydhingraapj
    @akshaydhingraapj 7 месяцев назад +1

    hello! This was a great solution indeed! But is there a way to count cells color for conditionally formatted cells?

    • @MrPolgouder
      @MrPolgouder 7 месяцев назад

      I was going to ask the same question. It does not work for cells which changed colour using conditional formatting. Could you please help?

  • @ellaminnowpea
    @ellaminnowpea 5 месяцев назад

    Excellent tutorial, thank you!

  • @richardsiemion5903
    @richardsiemion5903 10 месяцев назад

    I need to thank you. This is perfect and I needed it

    • @JopaExcel
      @JopaExcel  9 месяцев назад

      Glad it helped you! 🙏👍

  • @JY-rr7vt
    @JY-rr7vt 7 месяцев назад

    Thank you for this tutorial. Very helpful indeed!

  • @user-zt7id6mu7q
    @user-zt7id6mu7q 5 месяцев назад

    hi there, thanks for this function, but I have specific question...what if I want to split the cell for multiple color (let's say I've done several things in one day and marked them differently) but I want to count them all ?

  • @devender60
    @devender60 4 месяца назад

    Thanks for the amazing tutorial. How to save this permanently in the excel. When I am closing excel it is gone. Or everytime i have save the function.

  • @Zhuravi
    @Zhuravi 7 месяцев назад

    Thank you so much! Easy and quick!

    • @JopaExcel
      @JopaExcel  7 месяцев назад

      Glad it was useful! 🙏👍

  • @jilnajil5464
    @jilnajil5464 Месяц назад

    I have created the count color formula as per user instruction but the formula is not found in other file, can you help me to add that formula in whole excel file

  • @snezanasando3519
    @snezanasando3519 5 месяцев назад

    Great! It works. Thanks!

  • @anamariarodriguezcortes8737
    @anamariarodriguezcortes8737 6 месяцев назад

    This video was very useful. Thank you!

  • @akechelvira1890
    @akechelvira1890 5 месяцев назад

    Thank you so much. This helped me alot.

  • @BCOzSportsGamer
    @BCOzSportsGamer 3 месяца назад

    Is there a way to refresh the count? Seems I have to go into the cell then press enter.

  • @vmay002
    @vmay002 2 месяца назад

    Thanks a lot man!

  • @carlotacartola3130
    @carlotacartola3130 4 месяца назад

    Thank you for the video. The function works well when the cells that need to be analyzed are in the same Excel book in which I am making the function run. However, when I try to count the cells using a link to a different excel book, it only works when the referenced spreadsheet is open. If I refresh the excel in which the "COUNT_COLOR" function is being executed while the source excels are closed, I receive a "VALUE" error. I have verified the links, and they are not broken. Do you know how to fix the function so that it also works with references to other excel books?

  • @dwerty87great
    @dwerty87great 14 часов назад

    not working for color that applied from conditional formatting

  • @sushh1
    @sushh1 9 месяцев назад +2

    How do you select a range of cells that are separate?
    For example, I want to select C1, C4 and C6 but it gives me an error.

  • @rezahasan25
    @rezahasan25 2 месяца назад

    Excellent !!!

  • @theeeriepolymath539
    @theeeriepolymath539 10 месяцев назад

    God no one ever explained how to activate the developer tab!! thanks i was stuck om this from 3 days...Keep posting content..You're a good teacher and explain well

    • @JopaExcel
      @JopaExcel  10 месяцев назад +1

      You are right lol... I always like to teach objectively, but also showing all the small steps that are necessary to reach the final goal. Thanks for the positive feedback 🙏👍

  • @vanderwh
    @vanderwh 2 месяца назад

    If I change a color should the total auto update?

  • @fayaz004
    @fayaz004 7 месяцев назад

    Wow amazing.. this worked and saved lot of time.

    • @JopaExcel
      @JopaExcel  7 месяцев назад

      Glad it helped 🙏👍

  • @santiagodelorenzo8711
    @santiagodelorenzo8711 2 месяца назад

    hi, great tutorial! can you do that with font colours/format?

  • @AugustMoonchild
    @AugustMoonchild 3 месяца назад +1

    Why mine comes as #NAME?

  • @feezitic
    @feezitic 8 месяцев назад

    YOU SAVED ME THANK YOU!

    • @JopaExcel
      @JopaExcel  8 месяцев назад

      Glad it was useful. Thank you 🙏👍

  • @murilofernandes3492
    @murilofernandes3492 5 месяцев назад

    Thank you very much!

  • @rstcore885
    @rstcore885 2 месяца назад

    Hi, but what is the functuon if we want to summ/count colors between some dates there? F.e, we need to find sum or count between 19 jul and 27 jul?

  • @SPSCUTMUTIAH
    @SPSCUTMUTIAH Месяц назад

    thank you so much

  • @ankitanand8438
    @ankitanand8438 Месяц назад

    Second sheet random boxes are coming counted for me but not the first one shown..

  • @florruiz2881
    @florruiz2881 6 месяцев назад

    Loveeee❤🎉🎉🎉 thank You so much!

  • @DailyPositiveShots
    @DailyPositiveShots 3 месяца назад

    Thanks exactly looking for that

    • @JopaExcel
      @JopaExcel  3 месяца назад

      Your welcome. Glad it was useful 🙏👍

  • @Curious322
    @Curious322 3 месяца назад

    not working while using conditional formatting, can you help with that?

  • @mk67890
    @mk67890 6 месяцев назад

    Thank you for the code

  • @dearesthb
    @dearesthb 8 месяцев назад +1

    hello! this works amazing but is there a way to count cells color for conditionally formatted cells?

    • @tpg5974
      @tpg5974 7 месяцев назад

      Agreed!!!! Show me how to do that and I will be ecstatic!!!!!!

  • @dgoeloe
    @dgoeloe 9 дней назад

    Not working... I get the new function, but then trying to select the cell for the colors, I get an error.

  • @lostinbooks6433
    @lostinbooks6433 6 месяцев назад

    Hi, it does not work on cells with conditional formatting. Is there a way out? Thanks!

  • @-carlo.7882
    @-carlo.7882 2 месяца назад

    will it work on any version of excel?

  • @user-tt3wp7wi1x
    @user-tt3wp7wi1x 10 месяцев назад

    AMAZING Thank you so much!!

    • @JopaExcel
      @JopaExcel  9 месяцев назад

      Thanks 🙏👍

  • @mcesen1401
    @mcesen1401 7 месяцев назад

    Thank You!

  • @NicYan_S
    @NicYan_S 6 месяцев назад

    Best, but why when I add new cells with the same colors the count not changed automatically? its stay with count I counted at first

  • @kamelkh
    @kamelkh 3 месяца назад

    Thanks a lot genius

  • @HastingsDemolition
    @HastingsDemolition 5 месяцев назад

    thank you!

  • @Tornados27
    @Tornados27 7 месяцев назад

    Amazingly good

  • @arsalanchishty8985
    @arsalanchishty8985 3 месяца назад

    Hey had a question - I created some conditional formatting to mark some cells if they were blank or not. That part works fine. The colors go brown if they're blank and blue if they have text. But the issue is this code is NOT picking up my conditionally formatted cells for some reason. Any guidance on troubleshooting?

  • @xtremetravelvlogs9165
    @xtremetravelvlogs9165 6 месяцев назад

    Thank you boss !!

  • @eunizzzz
    @eunizzzz 9 месяцев назад +1

    Error "Compile error: Expected: identifier" appeared, what can I do?

  • @ashkan13541
    @ashkan13541 6 месяцев назад

    hi I added the formulation in macro but it doesn't work and massage formulation has a problem, I am using Mac , is there any limitation for the excels which using in Mac?