+ Reply to Thread
Results 1 to 4 of 4

Counting colored cells

  1. #1
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Counting colored cells

    I was wondering if I could count "colored" cells.

    From cpearson.com the VB coding is:

    =SUMPRODUCT(--(COLORINDEXOFRANGE(E28:E68,FALSE,1)=38))

    I want to use #38 (Pink) as the color used in different cells.

    Is there a formula to use instead of going to VB?

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Counting colored cells

    If the colour code is set manually then no is the answer
    (given 2008 obviously you have no VBA support per se - you can use XLM4 I believe - or AppleScript - neither of which I know much about)

    If there is logic determining the format (ie conditional formatting) then yes, ape the logic of the conditional formatting in your function.

  3. #3
    Forum Contributor
    Join Date
    11-13-2010
    Location
    Warren, Michigan
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    307

    Re: Counting colored cells

    Is there a "normal" coding to count "Colored" cells?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Counting colored cells

    I don't know what "normal" coding relates to.

    To reiterate, if the colour is being determined by logic [still unknown] then you should simply be looking to ape that same logic via a standard formula to conduct the count.

    If you're formatting manually/arbitrarily then you have a few issues ...

    1. Formatting a cell is not volatile action per se.
    As a result of the above: assuming you can identify the colour (read on) you still can not be 100% sure that your calculations will be accurate all of the time
    Using a Volatile construct will reduce the risk of error but will not remove it

    2. If your version is XL2008 then obviously you have no VBA support so the more traditional routes (UDF) are not open to you.

    3. If you can use older XLM calls then you might consider using those via Defined Names to retrieve the colour of a given cell (GET.CELL information 63).
    However, you would I think (realistically) need to store the results per cell and calculate off those stored values.

    The alternative would be to investigate creating full blown XLM scripts and/or use of AppleScript - neither of which I can help you with personally I am afraid.

    If you are not using XL2008 - please state which version(s) you are using.

+ 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