+ Reply to Thread
Results 1 to 2 of 2

Determining a cells background color using a formula

  1. #1

    Determining a cells background color using a formula

    I am trying to write a formula that will count the number of cells
    within a given range that have a specific background color. Does
    anyone know if this is possible?

    For example, my code might look something like this:
    =countif (cell.bgcolor="red",A1:A4)

    As an alternative, I am happy to populate each cell that is a specific
    color and then count them as a separate step. The implementation might
    be something like.
    =if(Cell.bgcolor="red",1,0)
    As a second step, I could count all of the cells that contain a 1
    within the range.

    Does anyone know how I may accomplish this either using an excel
    formula, or a script?


  2. #2
    Chip Pearson
    Guest

    Re: Determining a cells background color using a formula

    You can't do it with a formula. You need VBA code. See
    www.cpearson.com/excel/colors.htm for details and example code.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    <[email protected]> wrote in message
    news:[email protected]...
    >I am trying to write a formula that will count the number of
    >cells
    > within a given range that have a specific background color.
    > Does
    > anyone know if this is possible?
    >
    > For example, my code might look something like this:
    > =countif (cell.bgcolor="red",A1:A4)
    >
    > As an alternative, I am happy to populate each cell that is a
    > specific
    > color and then count them as a separate step. The
    > implementation might
    > be something like.
    > =if(Cell.bgcolor="red",1,0)
    > As a second step, I could count all of the cells that contain a
    > 1
    > within the range.
    >
    > Does anyone know how I may accomplish this either using an
    > excel
    > formula, or a script?
    >




+ 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