+ Reply to Thread
Results 1 to 10 of 10

Sum if Cells Highlighted Particular Colour

  1. #1
    Registered User
    Join Date
    12-22-2004
    Posts
    3

    Sum if Cells Highlighted Particular Colour

    I know I've written a formula like this ages ago, but I can't seem to recall.
    I want to write a formula that says to look at a table of cells, and to sum all cells that are highlighted a certain colour. Does anyone know how to do this? Thanks in advance!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Welcome to the forum, uberchick, you've been lurking a long time.

    This requires VBA. See http://www.cpearson.com/excel/colors.aspx.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-22-2004
    Posts
    3
    Thanks for the link... unfortunately, my VBA knowledge is almost non-existent. I'm pretty sure I didn't use VBA to do this before... is there another way?
    Thanks in advance!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    If you remember how you did it without VBA, you will earn my praise and admiration.

  5. #5
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    The only way you could do it without VBA is if the cells are coloured using conditional formatting.

    If this is the case, then you could sum them using the same rule as is used to colour them.
    Ed
    _____________________________
    Always learning, but never enough!
    _____________________________

  6. #6
    Registered User
    Join Date
    12-22-2004
    Posts
    3
    Unfortunately, the coloured cells are not conditionally formatted so this won't work. Thanks anyway!

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Equivalent to EdMac's suggestion, if the cells are colored according to some rule, then you can put a formula that encodes the rule in another column, and use that to conditionally sum the colored cells.

    There's potential for error if the cell colors don't allows follow the rule, though.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Here's an explanation of using VBA for this

    http://www.exceltip.com/st/Sum_by_co...Excel/517.html
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  9. #9
    Registered User
    Join Date
    11-05-2008
    Location
    sydney
    Posts
    1
    hi there i cant seem to post a thread but i was wondering if you could help inthis one please?

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by scotty2788 View Post
    hi there i cant seem to post a thread but i was wondering if you could help inthis one please?
    You cannot ask questions like this. Use the New Thread button to ask your own question

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Count the number of highlighted cells
    By Ford_Guy in forum Excel General
    Replies: 13
    Last Post: 07-17-2008, 08:17 AM
  2. function to classify adjacent highlighted cells
    By SlipperyPete in forum Excel General
    Replies: 3
    Last Post: 01-24-2008, 01:50 PM
  3. If statement searching for highlighted cells???
    By macmac21 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-21-2007, 11:44 AM
  4. 'Filter/Clean' Cells; 2 questions
    By EHS in forum Excel General
    Replies: 12
    Last Post: 11-15-2006, 07:32 AM
  5. IF A1="foobar" THEN change background colour for cells A2:A7?
    By Paltsi in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2006, 11:01 PM

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