+ Reply to Thread
Results 1 to 18 of 18

Summing the value of a range of cells

  1. #1
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Summing the value of a range of cells

    Hi All,

    I have the below code that combines the text in column C if the data in columns A, B, and D match. Is there any way to have the values in columns E totaled as well? If so, I would also like the values in column F added as well. The results I would like are on sheet 1 of my attachment. The raw data is on sheet 2.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Summing the value of a range of cells

    See if this works for you.
    Attached Files Attached Files

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Summing the value of a range of cells

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Summing the value of a range of cells

    @AB33: Sorry for off-topic interjection:

    Although there is no official rule regarding this behavior, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks again for all your hard work here!

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Summing the value of a range of cells

    Hi Trevor,
    There has numerous discussions on this topic..I know you are not going to like it, but I always post a sample book with code attached to it if the poster has posted an excel book.
    I am on the minority on this approach.No ifs and buts.
    Last edited by AB33; 06-30-2016 at 04:59 PM.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Summing the value of a range of cells

    @AB33: I don't think there's an issue posting a sample workbook. The suggestion is that you post the code in the body of the reply so others don't necessarily need to download and open the workbook. But, as you wish

  7. #7
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Summing the value of a range of cells

    Clash of the Guru's. Thank you both. I love how I spend hours trying to find a solution and both of you come up with it on your own in less than 20 minutes.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Summing the value of a range of cells

    No clash Maybe a slight difference of opinion You posted code AND a workbook; I returned just code, AB33 returned just a workbook. My guess is that you don't need the workbook back but it's often good to see the code updated and working IN the workbook.

    And thanks for the rep
    Last edited by TMS; 06-30-2016 at 06:17 PM.

  9. #9
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Summing the value of a range of cells

    How could I make it so that this macro cycles through six different sheets? The sheet names are Div.1, Div. 6, Div. 9, Div. 11, Div.12, and Div. 13.

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Summing the value of a range of cells

    You should have started a new thread. There are few ways, one way


    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Summing the value of a range of cells

    Sorry I thought since it was working with the same code it would be OK to just reopen. Next time I will start a new thread. I do not need to name all of the sheets?

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Summing the value of a range of cells

    No, the code loops through sheets which have a "Div" as sheet name and ignore the rest of sheets

  13. #13
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Summing the value of a range of cells

    How would I change the original code to work on a different workbook that has matching data in the "Account #" column (1), "Item" column (4), and "Request" column (6), and the values I want to sum in my "Order Qty." column (5)? There are a total of 8 columns.

    Please Login or Register  to view this content.
    I updated the names but I do not know how to successfully update the rest. My hour of trying has gotten me no where.
    Last edited by Teblol; 07-05-2016 at 08:10 PM.

  14. #14
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Summing the value of a range of cells

    Please attach a sample book with a desired result for testing.

  15. #15
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Summing the value of a range of cells

    Results can be found on the second sheet. Thanks!
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Summing the value of a range of cells

    Your description of the columns do not match with the data you attached.

    Please Login or Register  to view this content.

  17. #17
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Summing the value of a range of cells

    Sorry about that. I had changed something after my original description and didn't realize it would mess with the results.

    Thank you so much! I see how the macro works now. I can add cases without actually using them. I am still not entirely sure how the summing works but I am sure I will figure it out. Thanks again.
    Last edited by Teblol; 07-06-2016 at 10:38 AM.

  18. #18
    Forum Contributor
    Join Date
    10-10-2014
    Location
    New Jersey
    MS-Off Ver
    2010 & 2013
    Posts
    276

    Re: Summing the value of a range of cells

    Hey AB33,

    I am having an issue getting the code that runs through all of the sheets to work. I have created a new thread: http://www.excelforum.com/showthread...20#post4427320

+ 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: 4
    Last Post: 07-26-2013, 03:38 PM
  2. Summing up a variable range of cells
    By Nerdio in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-24-2013, 03:07 PM
  3. Replies: 4
    Last Post: 08-22-2012, 12:18 PM
  4. Summing a range of cells based on lookup value
    By ashas in forum Excel General
    Replies: 1
    Last Post: 08-29-2008, 03:17 AM
  5. [SOLVED] Summing cells in a range that has #VALUE!
    By cs_vision in forum Excel General
    Replies: 4
    Last Post: 07-17-2006, 06:15 PM
  6. [SOLVED] Summing cells in a range that has #VALUE!
    By cs_vision in forum Excel General
    Replies: 1
    Last Post: 07-17-2006, 06:08 PM
  7. Summing cells in a range that has #VALUE!
    By cs_vision in forum Excel General
    Replies: 0
    Last Post: 07-17-2006, 05:55 PM
  8. Summing cells in a range that has #VALUE!
    By cs_vision in forum Excel General
    Replies: 0
    Last Post: 07-17-2006, 05:35 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