+ Reply to Thread
Results 1 to 25 of 25

using "sumifs" rather than "sumproduct"

  1. #1
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769

    using "sumifs" rather than "sumproduct"

    Hello Everybody,
    I want to calculate hours for every truck in each day.A forum member helped me using sumproduct formula but it is very heavy in my original file.
    Required:
    I want to use "sumifs" rather than "sumproduct"
    See the attachment
    Waiting your help
    Attached Files Attached Files
    Last edited by leprince2007; 01-31-2017 at 03:23 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: using "sumifs" rather than "sumproduct"

    Try this...
    AA3=SUMIFS($V$4:$V$26,$A$4:$A$26,$Z3,$B$4:$B$26,AA$2)

    Also, use this in V4
    =SUMIFS(E4:T4,$E$3:$T$3,"hours")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769

    Re: using "sumifs" rather than "sumproduct"

    Quote Originally Posted by FDibbins View Post
    Try this...
    AA3=SUMIFS($V$4:$V$26,$A$4:$A$26,$Z3,$B$4:$B$26,AA$2)

    Also, use this in V4
    =SUMIFS(E4:T4,$E$3:$T$3,"hours")
    Please I want the function to depend on itself.
    Please download the attachment again I edited it.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: using "sumifs" rather than "sumproduct"

    AC15
    Please Login or Register  to view this content.
    =SUMIFS(INDEX($E$4:$T$100,,MATCH(AC$13,$E$2:$T$2,0)),$A$4:$A$100,$AA14,$U$4:$U$100,$AB14)
    Try this and copy across
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    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,339

    Re: using "sumifs" rather than "sumproduct"

    In AB4

    =SUMIFS($W:$W,$B:$B,AB$3,$A:$A,$AA4)

    in AC14

    =SUMIFS($E:$E,$A:$A,$AA14,$U:$U,$AB14)

    Change E:E to G:G, I,K, .... etc for each material

    OR use NflSales generic formula.
    Last edited by JohnTopley; 01-31-2017 at 04:04 AM.

  6. #6
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769

    Re: using "sumifs" rather than "sumproduct"

    Quote Originally Posted by FDibbins View Post
    Try this...
    AA3=SUMIFS($V$4:$V$26,$A$4:$A$26,$Z3,$B$4:$B$26,AA$2)

    Also, use this in V4
    =SUMIFS(E4:T4,$E$3:$T$3,"hours")
    The formula in AC15 works great.
    But the formula in AB4,I want it to depend on itself.
    waiting your feedback

  7. #7
    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,339

    Re: using "sumifs" rather than "sumproduct"

    You have answers already.
    Attached Files Attached Files
    Last edited by JohnTopley; 01-31-2017 at 05:00 AM.

  8. #8
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769

    Re: using "sumifs" rather than "sumproduct"

    Quote Originally Posted by JohnTopley View Post
    You have answers already.
    The formula in AB4,I want it to depend on itself.I mean Not to depend on "totals" column
    waiting your feedback
    Last edited by leprince2007; 01-31-2017 at 05:08 AM.

  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,339

    Re: using "sumifs" rather than "sumproduct"

    Why when you already know the total??

  10. #10
    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,339

    Re: using "sumifs" rather than "sumproduct"

    I doubt if there is a more efficient way than SUMPRODUCT to accomplish this.

    =SUMPRODUCT(($E$4:$T$100)*($E$3:$T$3="Hours")*($A$4:$A$100=$AA4)*($B$4:$B$100=AB$3))

  11. #11
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769

    Re: using "sumifs" rather than "sumproduct"

    Quote Originally Posted by JohnTopley View Post
    I doubt if there is a more efficient way than SUMPRODUCT to accomplish this.

    =SUMPRODUCT(($E$4:$T$100)*($E$3:$T$3="Hours")*($A$4:$A$100=$AA4)*($B$4:$B$100=AB$3))
    Just try it

  12. #12
    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,339

    Re: using "sumifs" rather than "sumproduct"

    I have and it works.

    Filtering for 22222 shows 8 hours for 20 NOV ( 1 and 7 ) as there are 2 entries

    Phocam's formula using match will only select the first (value 1)

    who is correct?
    Last edited by JohnTopley; 01-31-2017 at 06:55 AM.

  13. #13
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,923

    Re: using "sumifs" rather than "sumproduct"

    Removed by Phuocam.
    Last edited by Phuocam; 01-31-2017 at 06:45 AM.

  14. #14
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769

    Re: using "sumifs" rather than "sumproduct"

    Up....up.....up

  15. #15
    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,339

    Re: using "sumifs" rather than "sumproduct"

    So EXPLAIN what is wrong with SUMPRODUCT. what results are wrong?

    and please answer why not SUMIF .....

    Why when you already know the total??
    I am (almost) certain it cannot be done with SUMIFS as there is no way to select the hours column: hence the use (flexibility) of SUMPRODUCT
    Last edited by JohnTopley; 01-31-2017 at 03:22 PM.

  16. #16
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: using "sumifs" rather than "sumproduct"

    If you were prepared to change your layout so that you had 7 columns, i.e. your first four then columns for; Material Type, Units, & Hours you'd open up the powerful world of the Pivot Table and in the process give you a lot more flexibility for subsequent analysis and summarisation. You'd also avoid needing any functions or indeed VBA.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  17. #17
    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,339

    Re: using "sumifs" rather than "sumproduct"

    Using Richard's format see attached:

    in M5

    =SUMIFS($G:$G,$A:$A,$L4,$B:$B,M$3)

    in N14

    =SUMIFS($F:$F,$A:$A,$L14,$H:$H,$M14,$E:$E,N$13)
    Attached Files Attached Files

  18. #18
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: using "sumifs" rather than "sumproduct"

    Quote Originally Posted by leprince2007 View Post
    Please I want the function to depend on itself.
    Please download the attachment again I edited it.
    What is the problem with using the TOTAL column? It is there, why not use it?

  19. #19
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769
    Quote Originally Posted by JohnTopley View Post
    So EXPLAIN what is wrong with SUMPRODUCT. what results are wrong?

    and please answer why not SUMIF .....



    I am (almost) certain it cannot be done with SUMIFS as there is no way to select the hours column: hence the use (flexibility) of SUMPRODUCT
    Sumproduct gives the right answer.But it makes my file heavy in calculation .So i want to try another formula.
    Can you use any other formula that is faster in cakculation?
    Note: I use it in large data,and I use it more than 100 times

  20. #20
    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,339

    Re: using "sumifs" rather than "sumproduct"

    No: SUMIF is fastest BUT as you don't want to use the TOTAL .......


    OR

    you re-organise your file as per Richard's suggestion and then you can use SUMIFS (or PIVOT tables ... not my area of expertise!).

    How large is your data set (number of rows) ?

  21. #21
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769

    Re: using "sumifs" rather than "sumproduct"

    -Y
    Quote Originally Posted by JohnTopley View Post
    No: SUMIF is fastest BUT as you don't want to use the TOTAL .......


    OR

    you re-organise your file as per Richard's suggestion and then you can use SUMIFS (or PIVOT tables ... not my area of expertise!).

    How large is your data set (number of rows) ?
    My data is more than 1000 rows and the formula itself I use it a lot.
    Can you use any other formula??
    Last edited by leprince2007; 01-31-2017 at 05:08 PM.

  22. #22
    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,339

    Re: using "sumifs" rather than "sumproduct"

    As I have explained you only have 2 realistic options: SUMIF(s) or SUMPRODUCT.

    SUMPRODUCT on the formula I gave will complete in no time: so I suggest there are other problems.

    With SUMPRODUCT do not use full column ranges (A:A): use A2:A1000
    Last edited by JohnTopley; 01-31-2017 at 05:17 PM.

  23. #23
    Forum Contributor
    Join Date
    02-24-2015
    Location
    Egypt
    MS-Off Ver
    Office 365 ProPlus
    Posts
    769

    Re: using "sumifs" rather than "sumproduct"

    Quote Originally Posted by JohnTopley View Post
    As I have explained you only have 2 realistic options: SUMIF(s) or SUMPRODUCT.

    SUMPRODUCT on the formula I gave will complete in no time: so I suggest there are other problems.

    With SUMPRODUCT do not use full column ranges (A:A): use A2:A1000
    Ok thank you very much

  24. #24
    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,339

    Re: using "sumifs" rather than "sumproduct"

    I created a data set with 900 + rows and changing data does not seem to impact the SUMPRODUCT formula. It updates instantly.

  25. #25
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: using "sumifs" rather than "sumproduct"

    You also have not said (that I can see) why you dont want to use the TOTAL column?

+ 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. Replies: 5
    Last Post: 02-05-2019, 12:03 AM
  2. Replies: 35
    Last Post: 01-13-2016, 02:16 AM
  3. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  4. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  5. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  6. Replies: 5
    Last Post: 06-26-2006, 09:23 PM
  7. Replies: 7
    Last Post: 05-13-2006, 05:02 PM

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