+ Reply to Thread
Results 1 to 17 of 17

Doing a subtotal for a non defined range of cells

  1. #1
    Registered User
    Join Date
    09-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Doing a subtotal for a non defined range of cells

    I'm trying to do a subtotal for a division that contain numbers and I may have 50 or more divisions with no predifine number of data. Can you please help me find a formula that will do a subtotal at each divison when it finds one.
    this month:
    PPCA
    200
    300
    400
    PPCD
    500
    600
    PPSE
    800
    900
    200
    100

    next month:
    PPCA
    200
    PPCD
    500
    600
    700
    PPSE
    200
    300
    PPSD
    150

    So the number of cell that should be in the range varies and the number of division may vary as well.

    Thank you,

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Doing a subtotal for a non defined range of cells

    sproulx,

    Posting an example file will generally help you get better results/responses. However, for now - are all the entries above (ppca, 200, 300, etc) intended to go in the same column?
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    Registered User
    Join Date
    09-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Doing a subtotal for a non defined range of cells

    Yes! When you open the file where you see PPCM I want to subtotal everything underneath it and do that for each division in the report.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Doing a subtotal for a non defined range of cells

    Here you go

    I had to be a little sneaky, and use column F as a helper column (which I then hid) to place the "maths" ie running subtotals in. A little bit of conditional formatting to hide "FALSE" where there are 2 consecutive falses, and you're sorted. I'm sure there are much better ways to get the result you wanted, but.... it's the result you wanted.
    Last edited by BB1972; 09-12-2012 at 03:01 PM.

  5. #5
    Registered User
    Join Date
    09-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Doing a subtotal for a non defined range of cells

    Thank you very much for your help!!!

  6. #6
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Doing a subtotal for a non defined range of cells

    You've very welcome - glad I could help. Will you please be sure to mark this thread "solved" if you're happy that it is, so others don't spend time reading about a resolved issue. Thank you.

  7. #7
    Registered User
    Join Date
    09-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Doing a subtotal for a non defined range of cells

    Is there a way to make the total appear next to the division so I could refer to it using vlookup. I would like to see the total next to PPCM for example is that possible?

    Thanks again,

  8. #8
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Doing a subtotal for a non defined range of cells

    Do you mean like this:

  9. #9
    Registered User
    Join Date
    09-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Doing a subtotal for a non defined range of cells

    Actually no, it has to be next to the upper value where it find text

    the 2 799 028 should be next to PPCM at the top as it is the subtotal for that division.

    Thanks,

  10. #10
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Doing a subtotal for a non defined range of cells

    Using your posted workbook...I *think* this regular formula does what you want
    Please Login or Register  to view this content.
    Copy that formula down through F927.
    Note: for the last total to work E928 must contain text with at least 5 characters.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  11. #11
    Registered User
    Join Date
    09-12-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Doing a subtotal for a non defined range of cells

    It workssss!!!!! I'm so happy it makes my day! It is nice to know there are very intelligent people out there wanting to share there knowledge.

    Thank you!

  12. #12
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Doing a subtotal for a non defined range of cells

    Quote Originally Posted by Ron Coderre View Post
    Using your posted workbook...I *think* this regular formula does what you want
    Please Login or Register  to view this content.
    Copy that formula down through F927.
    Note: for the last total to work E928 must contain text with at least 5 characters.

    Is that something you can work with?
    Ron,

    That's great - much better than my ham-fisted attempt If you get a chance, could you tell me the significance of * as the MATCH lookup value?

    Thanks,

  13. #13
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Doing a subtotal for a non defined range of cells

    Quote Originally Posted by sproulx View Post
    It workssss!!!!! I'm so happy it makes my day! It is nice to know there are very intelligent people out there wanting to share there knowledge.

    Thank you!
    Glad you got sorted, sproulx.

  14. #14
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Doing a subtotal for a non defined range of cells

    Quote Originally Posted by BB1972 View Post
    Ron,

    That's great - much better than my ham-fisted attempt If you get a chance, could you tell me the significance of * as the MATCH lookup value?

    Thanks,
    The asterisk in the MATCH function causes it to match on any text...ignoring numbers.

  15. #15
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Doing a subtotal for a non defined range of cells

    Quote Originally Posted by sproulx View Post
    It workssss!!!!! I'm so happy it makes my day! It is nice to know there are very intelligent people out there wanting to share there knowledge.

    Thank you!
    Thanks for the kind words....I'm glad I could help.

  16. #16
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Doing a subtotal for a non defined range of cells

    Quote Originally Posted by Ron Coderre View Post
    The asterisk in the MATCH function causes it to match on any text...ignoring numbers.
    Many thanks, Ron - that'll help me, going forward.

  17. #17
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Doing a subtotal for a non defined range of cells

    @ sproulx

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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