+ Reply to Thread
Results 1 to 9 of 9

How to SUM a number of cells between the cells with background green

  1. #1
    Registered User
    Join Date
    10-23-2019
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    22

    How to SUM a number of cells between the cells with background green

    Hi All,

    I am looking for a function by which I can sum the numbers in a column in a way that three cells with green background is in between the numbers. I attached the file where I added two examles of the desired result to column D.

    Thanks in advance.

    Regards,
    Attached Files Attached Files

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: How to SUM a number of cells between the cells with background green

    Not possible. For suming of value you may need to create criteria. Excel not read color.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  3. #3
    Registered User
    Join Date
    10-23-2019
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    22

    Re: How to SUM a number of cells between the cells with background green

    I have now created to assist columns that work with numbers on top of the colour.

    I think it is doable.

    I appreciate if you have another look.
    Attached Files Attached Files

  4. #4
    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
    52,946

    Re: How to SUM a number of cells between the cells with background green

    So you want to sum all 1's, all 2's etc?

    =SUMIF(B:B,1,C:C)
    change ,1, to ,2, etc as needed.
    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

  5. #5
    Registered User
    Join Date
    10-23-2019
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    22

    Re: How to SUM a number of cells between the cells with background green

    Thanks.


    It is not working for this one. I need them D columns, the first one is seen clearly, the second one is far down at row 221. Please have a look. Basically I want to sum until 3 treen is passed, and till the fourth green.

  6. #6
    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
    52,946

    Re: How to SUM a number of cells between the cells with background green

    OK so what is the logic? Keep in mind that formulas cannot "see" colors.

  7. #7
    Registered User
    Join Date
    10-23-2019
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    22

    Re: How to SUM a number of cells between the cells with background green

    Yes the function cannot detect the colour that's why I added the assist column. Basically the numbers in assisst column change when the sign change from minus to plus or opposite in A column. So if we can say that sum values of Col D untill the sign of column A changes thress time, that would solve the problem.

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,650

    Re: How to SUM a number of cells between the cells with background green

    Perhaps this will be of some help.
    1. Copy the formula in cell B3 up to B2 so that the numbering starts and ends on the blank cells.
    2. Number column F: 4, 8, 12 etc. (series > column > step value: 4 > stop value: 72)
    3. Populate column G using: =SUMIFS(C$3:C$11414,B$3:B$11414,"<="&F3,B$3:B$11414,">="&F3-3)
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  9. #9
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: How to SUM a number of cells between the cells with background green

    Please try

    1. Defind name COLORED refer =GET.CELL(63,INDIRECT("rc",FALSE))
    2. In cell B3 use this formula (copy until end of data)
    Please Login or Register  to view this content.
    3. In cell D3 use this formula
    Please Login or Register  to view this content.
    4. Save file as macro enable (.xlsm or .xlsb)


    Regards.

+ 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. Replies: 0
    Last Post: 01-21-2015, 12:05 PM
  2. Replies: 1
    Last Post: 12-13-2013, 10:28 PM
  3. Counting Number of Cells That Are Green in a Column
    By skratchmo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 06:04 PM
  4. Number of cells with background
    By Michelle1234 in forum Excel General
    Replies: 1
    Last Post: 06-21-2010, 03:15 PM
  5. Replies: 4
    Last Post: 04-24-2009, 07:08 AM
  6. Counting the number of Cells with a Particular Background Colour?
    By Hamish in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-14-2006, 09:20 AM
  7. [SOLVED] How do I get excel to add cells by color? Like all green cells (s.
    By chakatania in forum Excel General
    Replies: 1
    Last Post: 03-08-2005, 07:06 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