+ Reply to Thread
Results 1 to 4 of 4

SUMIF color=...

  1. #1
    Forum Contributor
    Join Date
    06-25-2007
    Posts
    166

    SUMIF color=...

    Right now, I have a SUMIF function that works fine:

    =SUMIF(G12:G54,"SUBTOTAL",M12:M54)

    I've never seen this before, but is there a way to build cell color into a formula? For instance, in the equation above, I would only want to sum the cells in M12:M54 that were NOT highlighted yellow.

    Will I have to resort to VBA to do this?

    Thanks in advance,
    JChandler22

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon JChandler22

    You will have to resort to VBA to do this. Chip Pearson has a section devoted to this here :

    http://www.cpearson.com/excel/colors.htm

    Alternatively, you could donload my add-in via the link below which has a utility that will add the VBA code to your file for you (Ulitmate > Formulae > Add Function). The custom functions you would probably need would be CELLCOLOUR() and SUMCELLCOL(). The help file included gives full details of syntax.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Contributor
    Join Date
    06-25-2007
    Posts
    166
    Thanks for the reply, Dominic.

    I tried Chip's UDF, which would work well except for the fact that my colored cells are conditionally formatted, and the UDF doesn't pick up on that.

    Here's my attachment:
    example.zip

    You should be able to follow what I'm trying to do when you open that and take a look. Keep in mind that although I've only shown three tasks in this example, I have about 160 in my actual xls. I've erased all the real data here, as well.

    Thanks to anyone who can offer suggestions!

  4. #4
    Forum Contributor
    Join Date
    06-25-2007
    Posts
    166
    Ah, got it. A simple SUMIF function did the trick.

+ 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