+ Reply to Thread
Results 1 to 5 of 5

How to use Subtotal function within in a COUNTIF & SUMIF formula

  1. #1
    Registered User
    Join Date
    02-01-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    32

    How to use Subtotal function within in a COUNTIF & SUMIF formula

    Hi I have a formula:

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


    Now, when I use filters within the table of data, I have noticed this doesn't adjust the formula result accordingly. How can I get it to Subtotal when filtering data out?

    Thanks!

  2. #2
    Registered User
    Join Date
    02-01-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: How to use Subtotal function within in a COUNTIF & SUMIF formula

    Ok, so I have sort-of found what I need:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However, If I were to filter out Column D (customers name) and then add a filter to another column (to take out negative figures), if the total amount sits in the last line (which may then be filtered out because it has a negative figure in one of the other columns), no total shows up at all. Is there any way around this??

    I have attached an example spreadsheet with the filter on "Running Balance".

    Thanks
    Attached Files Attached Files

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

    Re: How to use Subtotal function within in a COUNTIF & SUMIF formula

    Hi,

    Not quite sure what your intention is here. I understand your issue here in that your current set-up wil only display the subtotal for each Customer alongside the last occurrence of that Customer in your list.

    But what are you wanting the value in column L when filtered to be? The subtotal of just those viewable (i.e. filtered) entries in column L for that Customer? Or, regardless of which of the several e.g. CUST3 entries are showing, the subtotal of all CUST3 entries, whether filtered or not?

    Regards
    Click * below if this answer helped

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

  4. #4
    Registered User
    Join Date
    02-01-2013
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: How to use Subtotal function within in a COUNTIF & SUMIF formula

    Column L tells me the total value of the customers orders that can be shipped once I filter out the negative stock (negative means we don't have it). However, we don't ship goods if the total value is less than $100, which is why I need a subtotal for each customer of only the items being shown.

    Thanks for your help

  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: How to use Subtotal function within in a COUNTIF & SUMIF formula

    Hi,

    I'm still not entirely sure I understand what you want here, but perhaps (in L2 and copy down):

    =IF(ROW(D2)=LOOKUP(10^10,IF(IF(SUBTOTAL(109,OFFSET($K$2:$K$100,ROW($K$2:$K$100)-MIN(ROW($K$2:$K$100)),0,1)),$D$2:$D$100)=D2,ROW($D$2:$D$100))),SUMPRODUCT(--($D$2:$D$100=D2),SUBTOTAL(109,OFFSET($K$2:$K$100,ROW($K$2:$K$100)-MIN(ROW($K$2:$K$100)),0,1))),"")

    If that isn't what you were after, I think the best thing would be for you to re-attach your workbook with a few more examples and your desired results (after filtering) in each case.

    Regards

+ 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. [SOLVED] Sumif formula in a subtotal
    By Jexcel2012 in forum Excel General
    Replies: 11
    Last Post: 06-25-2012, 06:40 PM
  2. [SOLVED] =Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]
    By thomas.mapua in forum Excel General
    Replies: 5
    Last Post: 01-06-2012, 11:33 AM
  3. [SOLVED] Embed a countif function in subtotal function?
    By Stuck at work in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-13-2006, 11:20 PM
  4. [SOLVED] COUNTIF Subtotal Function?
    By jcpotwor in forum Excel General
    Replies: 2
    Last Post: 01-12-2006, 10:00 AM
  5. [SOLVED] How do I use COUNTIF in a SUBTOTAL function to differentiate the .
    By Lettie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-22-2005, 05:06 AM

Tags for this Thread

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