+ Reply to Thread
Results 1 to 8 of 8

Sumproduct and Subtotal Question

  1. #1
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182

    Sumproduct and Subtotal Question

    Hi everyone!

    So I thought I had a very easy situation on my hands, but I can't seem to figure it out. I have a large data set for customer forecasting, each part record has 6 data points.

    For example, each record has:
    FCST Quantity
    FCST Revenue
    FCST Potential
    Price
    FCST Market Share

    What I currently have at the top of the file is SUBTOTAL(9, Ref1). Problem is that I need to drill down to the data point specifically to see the subtotal of that product type for that customer. What I would like to do is have two subtotals at the top of the sheet, one for FCST Quantity and one for FCST Potential. Of couse I thought about using SUMPRODUCT, it works but not when I add the complexity of AutoFiltering.

    So I tried =SUMPRODUCT(("FCST Quantity"=M6:M1000)*(SUBTOTAL(9,R6:R1000))) and it gives me a crazy number, not correct. But it does change when I use the autofilter, which tells me I am going down the right path.

    Does everyone understand the problem. I need to be able to subtotal to a specific criteria while using the autofilters....

    Please help!!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I think you are close

    Try this:

    =SUMPRODUCT(SUBTOTAL(9,OFFSET($R$6:$R$1000,ROW($R$6:$R$1000),,1)),--($M$6:$M$1000="FCST Quantity"))

    Where row 6 contains column headers
    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
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182
    Hi NBVC!!

    It works great!!

    I just don't understand how or why it works. Do you have a link to a site that will explain it?? Very interested!

    Thanks again!

    Matt

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by matt4003
    Hi NBVC!!

    It works great!!

    I just don't understand how or why it works. Do you have a link to a site that will explain it?? Very interested!

    Thanks again!

    Matt
    You are welcome!

    See here: http://www.contextures.com/xlFunctions04.html#Visible

  5. #5
    Forum Contributor
    Join Date
    05-18-2004
    Location
    Portland, Oregon
    MS-Off Ver
    2016
    Posts
    182
    Hi NBVC,

    I ran into a problem, my header information is on row 5 and the first data is on row 6. It seems when ever I have data in row 6, it is excluded from the SUM. Why is this??

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by matt4003
    Hi NBVC,

    I ran into a problem, my header information is on row 5 and the first data is on row 6. It seems when ever I have data in row 6, it is excluded from the SUM. Why is this??
    Try this formula:

    =SUMPRODUCT(SUBTOTAL(9,OFFSET($R$6:$R$1000,ROW($R$6:$R$1000)-MIN(ROW($R$6:$R$1000)),,1)),--($M$6:$M$1000="FCST Quantity"))

  7. #7
    Registered User
    Join Date
    03-25-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Sumproduct and Subtotal Question

    Hello,

    How can I use the SUBTOTAL on this kind of formulas?

    =SUMPRODUCT((($C$12:$C$511='Data WB'!$B$1)+($C$12:$C$511='Data WB'!$C$1)+($C$12:$C$511='Data WB'!$D$1)+($C$12:$C$511='Data WB'!$E$1)+($C$12:$C$511='Data WB'!$F$1)+($C$12:$C$511='Data WB'!$G$1)+($C$12:$C$511='Data WB'!$H$1)+($C$12:$C$511='Data WB'!$I$1)+($C$12:$C$511='Data WB'!$J$1)+($C$12:$C$511='Data WB'!$K$1)+($C$12:$C$511='Data WB'!$L$1)+($C$12:$C$511='Data WB'!$M$1))*T12:T511)



    Any help please ?

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Sumproduct and Subtotal Question

    AbuST,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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