+ Reply to Thread
Results 1 to 4 of 4

Adding only cells coloured using conditional formatting

  1. #1
    Registered User
    Join Date
    04-23-2013
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Adding only cells coloured using conditional formatting

    I have a column within which only cells containing a >0 value are highlighted using colour RGB = 221, 217, 196.

    I wish to sum only these cells, however any VBA I have been able to find specifies it does not work with conditional formatting. Can anyone give me a hand?
    Last edited by FranAgrippina; 04-25-2013 at 08:51 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Adding only cells coloured using conditional formatting

    Assuming your data is in cells D2:D18 for example

    =SUMPRODUCT((D2:D18>0)*(D2:D18))

    would only sum values which are greater than 0
    Elegant Simplicity............. Not Always

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Adding only cells coloured using conditional formatting

    Hi and welcome to the forum

    Use sunif() or sumifS() based onm the same rules you used for your CF
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    04-23-2013
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: Adding only cells coloured using conditional formatting

    My thanks to you both ....and I apologize for wasting your time....I was so busy seeing the trees...I forgot about the forest....the solution was indeed a basic one...one I should have thought about .... but no....I was caught up in a much more complex train of thought!. Again thank you....

+ 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