+ Reply to Thread
Results 1 to 5 of 5

count or sort on cell formatting

  1. #1
    Registered User
    Join Date
    01-26-2004
    Location
    Tasmania
    Posts
    3

    Question count or sort on cell formatting

    Hi everyone

    I've attached to this thread an image which I hope will assist in explaining what I am looking to achieve. I'd be most appreciative of any help you could provide.

    In cell A4 I would like to have the spreadsheet automatically calculate the number of blue cells contained in the range D4:I4 (in this example, 3). In cell B4 I would like it to calculate the number of brown cells in the same D4:I4 range (in this example, 1).

    Conditional formatting has been set up to automatically turn the cells in the D4:I4 range the same colour of the cells that they match in the range C1:H1 and these numbers (C1:H1) are altered frequently.

    I suppose what I'm asking is whether there is some way to total (at A4) the number of blue cells in D4:I4 by some kind of format match function, or would it be easier to have the formula / function at A4 search the range D4:I4 for the number of times any of those numbers match any of the numbers C1:H1 wherever they're placed, and if so, how would this be done / entered?

    I hope that all made sense, as I'm not particularly good at explaining these kinds of things ... please let me know if it hasn't :-)

    Thanks in advance once again for any suggestions you might have; they will certainlly help out big time.

    Sue :-)
    Attached Images Attached Images

  2. #2
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345
    Welcome to the forum.

    There is no way in Excel to count or sort on cell formatting, so you should add some helper cells to identify the condition that you use to format the cells. It could be done with VBA, but don't add VBA code to your worksbook if you don't have to.

    My attachment show you how it could be done. You should/could hide rows 7 to 11.

    You could skip the helper cells, and make a arrayformula instead, but array formulas can be difficult to understand, so I made it this way for you to better understand how it works. And the helper cells are also used for setting the conditional formatting.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-26-2004
    Location
    Tasmania
    Posts
    3
    Thanks Bjornar ... your answer has provided me with just what I'm looking for, and has resolved my query.

    Once again, many thanks!

    Sue :-)

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    What is your conditional formatting formulas?
    They could be used in a SUMPRODUCT to get the Sums without helper columns.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Registered User
    Join Date
    01-26-2004
    Location
    Tasmania
    Posts
    3
    Thanks for responding to my question - I very much appreciate it, however I have since finalised the spreadsheet using Bjornar's method. Thanks once again for your time and suggestion though; all the very best.

    Sue :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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