+ Reply to Thread
Results 1 to 7 of 7

Sum values according to their category

  1. #1
    Registered User
    Join Date
    07-22-2010
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    58

    Sum values according to their category

    Hello all,


    I have created a spreadsheet to help explain my problem SumCategory.xlsx

    In Column B, I have categories A,C,E,F.

    Column C contain values that belong to these categories.

    In Column D, I am summing to the values for each categories.

    Please note that I am not grouping the categories together, so for example, the different 'clusters' of A are summed separately (See Row 2 to 6 and Row 25 to 29)

    Also, on Row 19, where there is only one value for 'E', I am taking this as the sum



    I would like some help to write the VB macro that would do these summations

    Please ask me if I have not explained properly

    Thanks in advance

    Lovi
    Last edited by lovi; 12-04-2012 at 12:09 PM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Sum values according to their category

    Hi Lovi,

    Try using below formula:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached workbook where I have used a counter column

    SumCategory.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Sum values according to their category

    See if this take care your needs.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    07-22-2010
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Sum values according to their category

    Thank you! this works perfectly!

    Unfortunately my problem has changed a little bit. I had to add another parameter 'Group'. The sum would now be for values from the same group AND category. I have uploaded a workbook here to explain (I have modified Fotis' spreadsheet) lovi sumcategory2.xlsm

    Could you help with this modification please?

    Thanks
    Lovi

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Sum values according to their category

    See this pls.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-22-2010
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Sum values according to their category

    Hello Fotis,

    This is perfect! Thank you very much!


    I actually have another query here http://www.excelforum.com/excel-prog...variable.html? maybe you can help

    Once again thanks a lot!

    Lovi

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Sum values according to their category

    You are welcome.

    Thanks for the reb*.

    I don't have muthc time any more but i'll take a look...

+ 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