+ Reply to Thread
Results 1 to 5 of 5

Counting cells that are red in font colour

  1. #1
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Counting cells that are red in font colour

    I Hope someone can help me here....

    I have a pivot and in the column next to the pivot (for this example column AI) in cell AI5 i want it to calculate the number of celss betwen W5:AG5 where the font colour is red.

    I have used conditional formatting to pick out the cells that font colour should be red based on a value.

    I have looked over the internet for solutions and also tried testing a few functions and formulas myself but to no avail.

    I have now come to a conclusion that code is needed to be able to do these calculations.

    Would anyone have any idea how this can be done?

    Dan

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Counting cells that are red in font colour

    What is the condition that drives the conditional format? You can derive a count of those cells (using COUNTIF) with a similar condition in the formula.

    Pete

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Counting cells that are red in font colour

    Does this help?

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Counting cells that are red in font colour

    I dont know why i was trying to complicate things!!

    I used your idea Pete_UK, but used a sumif, as i need to sum the total of the value in the cells in the range if it is less than 25, this now works fine, and obvioucly there is no need for condityional formatting.

    John, that does help yes thank you, and could be a handy code to have for future reference, as i tend to use conditional formatting based on cell colour and font,

    Thank you both

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Counting cells that are red in font colour

    Well you said you needed to:

    calculate the number of celss betwen W5:AG5 where the font colour is red.
    which I took to mean COUNT them, but it's the same approach if you need to SUM them.

    Glad you got it working.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1