+ Reply to Thread
Results 1 to 5 of 5

Sumif and Subtotal

Hybrid View

  1. #1
    Registered User
    Join Date
    05-20-2012
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Sumif and Subtotal

    Hi, I've gone beyond my ability with the attached, so grateful for any help. In cell H5 of the 'Order Form' worksheet, I'm trying to get an accurate calculation for the number of egg boxes to be delivered to customers this week. The source data for the calculation is on the Customers worksheet, where Column J shows how many boxes each customer wants (a box costs £1.25 so £2.50 = 2 boxes, etc.). Any character whatsoever in 'Customers' Column K means that the customer is on holiday and therefore their box/es should not be counted. Lastly, 'Customers' is filtered and I want the total in 'Order Form' H5 to count only the visible customers. I know that somehow I need to combine Subtotal and Sumif, but I can't find a solution. Thanks for your help!Sample customer spreadsheet.xls

  2. #2
    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
    48,180

    Re: Sumif and Subtotal

    SUBTOTAL(101,...) is for an Average, hence the #DIV/0! error for Half Standard ... no entries in the range.

    SUBTOTAL(102,...) is a COUNT
    SUBTOTAL(109,...) is a SUM

    From the Help on the function:

    HTML Code: 

    I don't really understand your layout or logic so I can't really offer much more help.

    Regards, TMS

    Regards, TMS
    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


  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Sumif and Subtotal

    hi djcfisher, perhaps you can do a SUMIFS or SUMPRODUCT formula that is according to your filter instead of using SUBTOTAL. something like this:
    =SUMPRODUCT((J6:J89)*(K6:K89="")*(O6:O89="")*(L6:L89={"1,2","1,2,3,4"}))/1.25

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    05-20-2012
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Sumif and Subtotal

    Hi benishiryo, thanks for the suggestion ... that works well when that particular filter is applied ... is there a simple way to get it to respond when a different filter is applied (e.g. {"1,2","1,3"} etc.?). The filter changes every week. Thanks very much for your help!

  5. #5
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Sumif and Subtotal

    sure thing. place somewhere in your main worksheet a place to put criteria horizontally, say in O1:R1 and formulate as such:
    =SUMPRODUCT((J6:J89)*(K6:K89="")*(O6:O89="")*(L6:L89=O1:R1))/1.25

    only put in there what you want to see. in you scenario, just "1,2" & "1,3" without the double quotes.

+ 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