+ Reply to Thread
Results 1 to 8 of 8

Subtotal question

  1. #1
    Registered User
    Join Date
    06-18-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    16

    Subtotal question

    Hello everyone, I am a bit confused with Subtotal function in my file. Please download my file to see the problem.

    When I sort the person name "Name 1" everything works including column N(Subtotal value). but when i sort the person name " Name 2", the value in column N is not correct. N118 should be 30 but it shows 0. As a result, the value after N118 is not correct.

    Please help me figure it out how to solve this one.
    Thank you.

    Edit: Update file
    Attached Files Attached Files
    Last edited by Applebus; 04-17-2018 at 01:42 AM. Reason: Update File

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,782

    Re: Subtotal question

    What are you expecting the answer to be when you filter?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-18-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    16

    Re: Subtotal question

    I expect the the value in column N not to be 0 but 30 as in this file.

    As I understand, subtotal(9,ref) is used to sum the value which is not hidden when data is sorted.
    In this file, when I sort "Name2", subtotal in N117 should be 0 which is correct and N118 should be 30 not 0 as it sums N117 too which is not hidden.
    so I am confused why the value of N118 is 0.
    Attached Files Attached Files
    Last edited by Applebus; 04-17-2018 at 01:43 AM.

  4. #4
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: Subtotal question

    hi

    =AGGREGATE(9,5,$J$3:J117) instead of subtotal

  5. #5
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Subtotal question

    Hi,

    when you filter name 1, the subtotal in column J = 30
    when you filter name 1, the subtotal in column J = 990

    your formula in column N is =SUBTOTAL(9,ref), accordingly, the formula in
    cell N118: =SUBTOTAL(9,$J$3:J117) = 30
    cell N119: =SUBTOTAL(9,$J$3:J118) = 60

    means the value in column N always increased by 30, 30 to 60 to 90 to 120 to 150..etc., but you have mentioned in your file that the value should be always 30 which is wrong

    if the above is correct, please check the attached file, it is solved by adding new column after column J, namely column K, and column N which automatically will be column O will take the ref from column K instead of J.

    please confirm...
    thanks.

    Edit: the formula provided by Sadath31 will give you the same result also...it is correct but i noticed it after i post mine.
    Attached Files Attached Files
    Last edited by boss1982; 04-17-2018 at 03:02 AM.

  6. #6
    Registered User
    Join Date
    06-18-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    16

    Re: Subtotal question

    Thank you very much, boss1982 and Sadath31.
    it really helps me solve the problem. and yes the value "30" is wrong.
    I also googled how to use aggregate as I've never used it before.
    Also some tips for using subtotal https://stackoverflow.com/questions/...als-shows-zero

  7. #7
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Qatar
    MS-Off Ver
    Excel 2010
    Posts
    171

    Re: Subtotal question

    glad to know that it is solved now, please Add Reputation to the persons who helped you and mark the threads as "solved"

  8. #8
    Registered User
    Join Date
    06-18-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    16

    Re: Subtotal question

    Done!! Again, Thank you very much

+ 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. Sumproduct and Subtotal Question
    By matt4003 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-25-2013, 07:00 AM
  2. Subtotal in VBA, coding question
    By D3Pratt in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-03-2009, 02:54 PM
  3. Subtotal question
    By oraculox in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-15-2007, 02:50 PM
  4. subtotal question?
    By wonderdogs828 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-03-2006, 07:10 PM
  5. Replies: 1
    Last Post: 01-03-2006, 06:15 PM
  6. VBA Subtotal question
    By hooper in forum Excel General
    Replies: 1
    Last Post: 12-18-2005, 04:10 PM
  7. subtotal question
    By Gary Keramidas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2005, 10:05 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