+ Reply to Thread
Results 1 to 15 of 15

sum in groups

  1. #1
    Registered User
    Join Date
    02-09-2022
    Location
    India
    MS-Off Ver
    student 2019
    Posts
    8

    sum in groups

    hi,
    i want to add a total row after each name that display desire sum.my problem is clear please see attached file in my post
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,035

    Re: sum in groups

    If you want to ADD a row containing the total, that will require VBA. If that is OK with you, I will move your thread to the correct sub-forum. Please confirm.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    02-09-2022
    Location
    India
    MS-Off Ver
    student 2019
    Posts
    8

    Re: sum in groups

    not require VBA. i only want to ADD a row containing the total.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,035

    Re: sum in groups

    You can't. The next best thing might be something like this:

    =IF(A3<>"",SUM(C$2:C2)-SUM(D$1:D1),"")
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,035

    Re: sum in groups

    This is better...

    =IF(A3<>"",SUM(C$2:C2)-SUM(D$1:D1),IF(C3="",C2,""))
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-09-2022
    Location
    India
    MS-Off Ver
    student 2019
    Posts
    8

    Re: sum in groups

    Can we like this
    1. First we count merged row in name column. 2. For counted rows sum price from Rohan's first row to counted row. 3. Add row containing sum after counted row. 4. DO this for next i.e Sohan…and so on…

  7. #7
    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,427

    Re: sum in groups

    You could use Grouping with Subtotals but, for that, you would need to repeat the names.

    https://support.microsoft.com/en-us/...e-b0a3d4a52b3a
    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


  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,427

    Re: sum in groups

    3. Add row containing sum after counted row.
    You can't add rows automatically without VBA.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,035

    Re: sum in groups

    1. I have given you a workaround.

    2. You don't like it.

    3. It needs VBA.

    4. you don't want VBA.

    5. Good Luck, but I'm out.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: sum in groups

    I'm confused.

    I did what TMS suggested. The output was exactly as your sample indicates. I did have to move your sample output range below the source data so the rows lined up.

    What am I missing?
    Attached Files Attached Files
    Last edited by FlameRetired; 02-09-2022 at 04:18 PM. Reason: Uploaded file
    Dave

  11. #11
    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,427

    Re: sum in groups

    @FR: I didn't think you'd get away with leaving the merged cells as they are. Seems you can. Who'd a thought? Looks exactly as required

  12. #12
    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,427

    Re: sum in groups

    I note that the merged cells present a problem should the OP wish to insert rows, but I suspect that would be a problem with the original layout.

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: sum in groups

    Yeah I was confused about the insert rows part. I couldn't see where the sample output reflected that. I am not sure I am grasping the concept.

  14. #14
    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,427

    Re: sum in groups

    Well, I guess we have done what we can … and it doesn’t involve VBA. So, we just sit back and wait for some feedback.

  15. #15
    Registered User
    Join Date
    02-09-2022
    Location
    India
    MS-Off Ver
    student 2019
    Posts
    8

    Re: sum in groups

    Thanks Glenn kennedK and FlameRetired

+ 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. Pivot Table with Sub-Groups repeating for all Major Groups error
    By Carla77 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-24-2020, 01:38 PM
  2. (Look up between tables) Convert Individuals Into Groups, Tally Groups
    By vsShinobi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2019, 12:37 PM
  3. Replies: 8
    Last Post: 02-28-2018, 10:34 AM
  4. Replies: 26
    Last Post: 01-15-2016, 03:38 AM
  5. Replies: 4
    Last Post: 07-22-2015, 07:13 AM
  6. Replies: 0
    Last Post: 10-01-2012, 05:54 AM
  7. Analysing groups of cells to form new groups
    By lurker17260 in forum Excel General
    Replies: 3
    Last Post: 02-08-2012, 04:45 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