+ Reply to Thread
Results 1 to 14 of 14

convert Sumifs to sumproduct or similar

  1. #1
    Registered User
    Join Date
    11-16-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    31

    convert Sumifs to sumproduct or similar

    Hi Everyone

    This is my very first post here and I'm wondering if you could help me? I have lost 2 days so far trying to figure this out.

    I have this formula that does exactly what I want it to do =SUMIFS('2021'!$AD$15:$AD$493,Dates,">="&F$2,Dates,"<"&EDATE(F$2,1),WalletType, "="&$C4) except when I use the auto filters which I need to manipulate the figures but the values do not adjust. (Dates named range 2021'!$F$15:$F$500) (WalletType named range 2021'!$Ac$15:$Ac$500)

    I believe I need to use something similar =SUMPRODUCT(SUBTOTAL(9,OFFSET(2021'!$F$15,ROW(2021'!$F$15:$F$500)-ROW(2021'!$F$15),0))*(2021'!$F$15:$F$500>=$G$10)*(2021'!$F$15:$F$500,<=$G$11)*(2021'!$AD$15:$AD$500)*(2021'!$Ac$15:$Ac$500=c12) but cannot make it work.

    I am trying to produce a stock plan for stock items that are going to be). So have created a quick example document to assist my explanation the formulas above are not taken from the example just to clarify

    The items are added to the project projections tabs on a year by year basis this will show all the history over time without the list becoming too huge and giving us useful history information. The date is added for when the items are required and the product is selected from a drop down list and a quantity placed in the quantity box next to it.
    On the stock requirements tab I want to see the items for each product type by month. The production description on this page also works as a drop-down list for the other tabs. Via a data validation list
    I need to collate the totals for each product for the month and show them in the stock requirement form
    My intention is to use the orange year drop down box to be able to change the overview to look at the different years.
    I need to use data filters on the project projection tabs to manipulate the information on the stock requirements tab.
    Attached Files Attached Files

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: convert Sumifs to sumproduct or similar

    the SUBTOTAL/OFFSET approach isn't great, from a performance angle, so I would suggest that instead, for ultimate flexibility, you add a new field to your source to flag row visibility, e.g

    =SUBTOTAL(2,[Dates])
    this will return 1 if the row is visible (via filtering), 0 if filtered out

    you can then add this new field to your SUMIFS with a fixed criteria of 1 -- this will ensure you only ever include visible rows

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,208

    Re: convert Sumifs to sumproduct or similar

    I would change your dates in rows 8 and 9 as having TEXT dates is not good practice

    in G8

    =DATE($D$4,COLUMN(A$1),1)

    in G9

    =EOMONTH(G$8,0)

    copy both across

    Formulas are going to further complicated as you need to use INDIRECT to reference the "Variable" sheets.

    in G10 [as example]

    =SUMPRODUCT((INDIRECT("'Project Projections "&$D$4&"'!$E$8:$E$28"))*(INDIRECT("'Project Projections "&$D$4&"'!$B$8:$B$28")>='Stock Requirement'!G$8)*(INDIRECT("'Project Projections " & $D$4 &"'!$C$8:$C$28")<='Stock Requirement'!G$9)*(INDIRECT("'Project Projections " & $D$4 &"'!$D$8:$D$28")='Stock Requirement'!$C10))
    Attached Files Attached Files
    Last edited by JohnTopley; 10-13-2021 at 07:22 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Registered User
    Join Date
    11-16-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    31

    Re: convert Sumifs to sumproduct or similar

    Hi XLent
    Thanks for this suggestion do you mean like this?

    =SUBTOTAL(2,[Dates] ('2021'!$AD$15:$AD$493,Dates,">="&F$2,Dates,"<"&EDATE(F$2,1),WalletType, "="&$C4)

  5. #5
    Registered User
    Join Date
    11-16-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    31

    Re: convert Sumifs to sumproduct or similar

    Hi John

    Thanks so very much for the updated example. I missed that to start with. If I filter the project projections 2021 to exclude "Wallet Clear Plastic -B/fly/A7 Slot" the total amount still remains under January. This needs to only report on what is visible in the data filters (I did have to remove the blue line to make the auto filter work but that was me not thinking.)

    I hope you understand what I mean.

    many thanks

    Stephen

  6. #6
    Registered User
    Join Date
    11-16-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    31

    Re: convert Sumifs to sumproduct or similar

    Hi John

    Thanks so very much for the updated example. I missed that to start with. If I filter the project projections 2021 to exclude "Wallet Clear Plastic -B/fly/A7 Slot" the total amount still remains under January. This needs to only report on what is visible in the data filters (I did have to remove the blue line to make the auto filter work but that was me not thinking.)

    I hope you understand what I mean.

    many thanks

    Stephen

  7. #7
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: convert Sumifs to sumproduct or similar

    Quote Originally Posted by Stephen Reeves View Post
    Hi XLent, Thanks for this suggestion do you mean like this? =SUBTOTAL(2,[Dates] ('2021'!$AD$15:$AD$493,Dates,">="&F$2,Dates,"<"&EDATE(F$2,1),WalletType, "="&$C4)
    Hi, no; the SUBTOTAL field would reside on your Data tabs, directly -- that 0/1 field would then be referenced in your various SUMIFS with a fixed criteria of 1 (visible)

    Refer attached for working example -- note, the file has 3 tables, 2020 + 2021 and then a further table which = either 2020 or 2021 based on selection thereby avoiding need for INDIRECT {volatile, like OFFSET approach}

    hopefully this gives you some idea.... the results will adjust relative to year, and filter applied on source data tab
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-16-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    31

    Re: convert Sumifs to sumproduct or similar

    Thanks XLent

    This does exactly what I need it to do. The only problem I have now is if I convert my current spreadsheets to Tables it seems to break other things

    is it possible to do the same but without making tables?

    Thanks

    Stephen

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,208

    Re: convert Sumifs to sumproduct or similar

    This now works on filter using XLent approach: and I would not worry to much about INDIRECT and performance for a few sheets!

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

  10. #10
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: convert Sumifs to sumproduct or similar

    ...is it possible to do the same but without making tables?
    Yes, I just used Tables for sake of expediency -- if you were to highlight both Tables in my earlier attachment and "Convert to Range" you will find the master table simply references the now defunct table ranges explicitly
    (obviously you can have non-volatile dynamic names if you need them to expand/contract as you add data, akin to Table behaviour)

    I fully accept @JohnTopley's note regards prudent use of Volatiles however, IME on this board (over the years) I've seen enough examples of people complaining of calc overhead to advocate non-volatile alternatives wherever feasible - esp. as we only have a limited idea of the calc tree dependencies etc; the use of the SUBTOTAL field on each source range is always worthwhile as it greatly simplifies the calculation, irrespective of volatility concerns.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,208

    Re: convert Sumifs to sumproduct or similar

    @XLent:I must remember your SUBTOTAL "trick"-something I was unaware of. Never too old to learn!

  12. #12
    Registered User
    Join Date
    11-16-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    31

    Re: convert Sumifs to sumproduct or similar

    Thank you Xlent and JohnTopley for your help with this. You have managed to solve my issue, I'm really pleased with the final result!

    Regards

    Stephen

  13. #13
    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,915

    Re: convert Sumifs to sumproduct or similar

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.
    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.

  14. #14
    Registered User
    Join Date
    11-16-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    31

    Re: convert Sumifs to sumproduct or similar

    Thank you, I've Marked the Thread as Solved

+ 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. Convert Sumproduct/SumIFS into VBA Dictionary
    By Edgie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2019, 06:36 PM
  2. How can i convert sumifs to sumproduct
    By svergili in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-18-2019, 10:21 AM
  3. Convert SUMPRODUCT to SUMIFS
    By teststrip in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-03-2017, 05:15 PM
  4. Using SUMIFS & LARGE (or similar?)
    By shalx in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-08-2014, 06:42 AM
  5. [SOLVED] Convert SUMIFS formula to SUMPRODUCT
    By timbury1 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-08-2014, 01:18 PM
  6. SUMIFS with MONTH() or other similar functions
    By e_lad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2011, 11:25 AM
  7. Formula similar to SUMIFS
    By cmb80 in forum Excel General
    Replies: 10
    Last Post: 02-09-2011, 10:38 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