+ Reply to Thread
Results 1 to 5 of 5

Resolved >>> Subtotal with condition

Hybrid View

  1. #1
    Registered User
    Join Date
    10-24-2007
    Location
    Kuwait
    Posts
    6

    Resolved >>> Subtotal with condition

    I need help in using a subtotal formula by putting a condition to it.

    I would like to know if:

    =SUBTOTAL(2,A2:A100) can be used in combination with any other formula so that when the data is filtered using autofilter it will only count values greater than zero.

    I have attached a worksheet with the example.

    In the attached workbook subtotal formulas are used in Row1 for sum and row 2 for count.
    When the data is filtered using code "DUP" in column D, the subtotal in cell C2 is "4", whereas in the specified range there is a positive value in only 1 cell that is $1050 in cell C99.
    Is there some combination that can be used with SUBTOTAL formula so that it will only count values greater than zero when data is filtered.
    Your help will be highly appreciated.
    Thank You,
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try this formula in A2 copied across.

    =SUMPRODUCT(SUBTOTAL(2,OFFSET(A$4:A$118,ROW(A$4:A$118)-MIN(ROW(A$4:A$118)),,1)),--(A$4:A$118>0))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-24-2007
    Location
    Kuwait
    Posts
    6
    Thanks a lot NBVC. I had been racking my brains for the past 2 days on this one.

  4. #4
    Forum Contributor
    Join Date
    01-18-2009
    Location
    Montreal
    MS-Off Ver
    MS Office 2016
    Posts
    111

    Re: Resolved >>> Subtotal with condition

    Great Formula!

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Resolved >>> Subtotal with condition

    Quote Originally Posted by jantonio View Post
    Great Formula!
    Sure. But also seven (!!) years old!
    Click * below if this answer helped

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

+ 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