+ Reply to Thread
Results 1 to 4 of 4

How To Count And Sum Cells Based On Background Color In Excel?

  1. #1
    Registered User
    Join Date
    08-29-2018
    Location
    Greece
    MS-Off Ver
    MS Office 2017
    Posts
    47

    How To Count And Sum Cells Based On Background Color In Excel?

    How To Count And Sum Cells Based On Background Color In Excel?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: How To Count And Sum Cells Based On Background Color In Excel?

    If the background colour has been applied through conditional formatting, then you could use a conditional sum formula (using SUMIF, SUMIFS or SUMPRODUCT etc.) which makes use of the criteria set up for the conditional formatting.

    If the colour has been applied manually, or via some macro, then you would have to use a macro to sum the appropriate values.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-29-2018
    Location
    Greece
    MS-Off Ver
    MS Office 2017
    Posts
    47

    Re: How To Count And Sum Cells Based On Background Color In Excel?

    I try with this VBS :

    Please Login or Register  to view this content.
    this method work but the problem is with conditional formatting rules excel cell... e.g i have a rule when user add on cell number "6" then add black background color and sum 6 with next 6 cell this method not work with the script. if i add black color with paint tool then sun and count correct... can you help me there?
    ?

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: How To Count And Sum Cells Based On Background Color In Excel?

    You should really stick to manual shading or conditional formatting, it gets messy using both. Conditional formatting is better, as it is quicker and can use inbuilt functions, rather than vba code, and stops the risk of 2 manual colours being a slight difference in colour or shade and not being counted. why not attack a sample workbook

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

+ 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. [SOLVED] Count Cells based on background color of conditional formats
    By scrabtree23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2018, 08:53 AM
  2. Replies: 1
    Last Post: 11-11-2017, 09:52 AM
  3. Count / Sum based on Background Color with Manual and Conditional Format Color
    By sam99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2014, 08:00 PM
  4. Change cell background color based on another cells background color
    By Queo in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 06-10-2014, 05:28 AM
  5. Replies: 3
    Last Post: 05-02-2012, 09:08 AM
  6. Count Cells Based On A Background Color
    By NSTurk725 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2010, 11:29 AM
  7. [SOLVED] How do you count cells with background color yellow?
    By Stephanie D in forum Excel General
    Replies: 6
    Last Post: 10-18-2005, 12:05 AM

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