+ Reply to Thread
Results 1 to 13 of 13

Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    11

    Angry Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    I am trying to get this function to add only the specified rows of 6414,6415,6416,6425 but it is not summing and giving me a value of 0.

    =SUMPRODUCT(SUMIF(A:A,"*6416*",E:E),SUMIF(A:A,"*6414*",E:E),SUMIF(A:A,"*6415*",E:E),SUMIF(A:A,"*6425*",E:E))

    When I eliminate part of the function to only include a portion that I know gets results it correctly gives me the right amount but I need them all to be included.

    =SUMPRODUCT(SUMIF(A:A,"*6416*",E:E))

    Any thoughts?

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    you get better help if you add a small excel file, without confidential information.

    please also add manualy the expected result in your file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    06-24-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    11

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    Should I insert an image of the excel file or the file itself, something that can be edited within excel?

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    The sumproduct would be MULTIPLYING each result of SUMIF, not ADDING.
    So it would do
    SUMIF(A:A,"*6416*",E:E)*SUMIF(A:A,"*6414*",E:E)*SUMIF(A:A,"*6415*",E:E)*SUMIF(A:A,"*6425*",E:E)

    To ADD them, you would just change SUMPRODUCT to SUM in your original formula.

    Or
    =SUMIF(A:A,"*6416*",E:E)+SUMIF(A:A,"*6414*",E:E)+SUMIF(A:A,"*6415*",E:E)+SUMIF(A:A,"*6425*",E:E)

    Here's a shortcut for that.

    =SUM(SUMIF(A:A,{"*6416*","*6414*,"*6415*","*6425*"},E:E))
    Last edited by Jonmo1; 06-24-2015 at 01:06 PM.

  5. #5
    Registered User
    Join Date
    06-24-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    11

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    Thank you, thank you!!! That makes sense, I didn't catch that! This forum is the best

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    You're welcome.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    I'm not clear what the use of wild cards is achieving....

    =SUM(SUMIF(A:A,{6416,6414,6415,6425},E:E))

    if these four numbers are in column A, the corresponding values in column E will be summed.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  8. #8
    Registered User
    Join Date
    06-24-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    11

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    =SUM(SUMIF(A:A,"*6416*",H:J),SUMIF(A:A,"*6414*",H:J),SUMIF(A:A,"*6415*",H:J),SUMIF(A:A,"*6425*",H:J),SUMIF(A:A,"*158*",H:J),SUMIF(A:A,"*6412*",H:J))
    This formula now is yielding 0 is it because of the H:J?

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    Quote Originally Posted by Glenn Kennedy View Post
    I'm not clear what the use of wild cards is achieving....
    Column A must contain text strings like ABC6416DEF or something..
    You're right it wouldn't work on numeric values in A.
    Last edited by Jonmo1; 06-24-2015 at 01:19 PM.

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    Quote Originally Posted by kiddles13 View Post
    is it because of the H:J?
    Yes
    Both the Criteria Range and the Sum Range must be same dimensions.

  11. #11
    Registered User
    Join Date
    06-24-2015
    Location
    MN, USA
    MS-Off Ver
    2010
    Posts
    11

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    Well how do I include columns H:J because I need to be pulling from these three columns only to A:A

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    Is there going to be any more requirements added?

  13. #13
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Using the SUMIFS and SUMPRODUCT functions and getting arrays to correctly sum

    =SUM(SUMIF(A:A,{"*6416*","*6414*","*6415*","*6425*"},H:H),SUMIF(A:A,{"*6416*","*6414*","*6415*","*6425*"},I:I),SUM(SUMIF(A:A,{"*6416*","*6414*","*6415*","*6425*"},J:J)))

    Any reason you can't just include 3 formulas?


    Thank you btw Jonmo1 - that was a neat trick - didn't know you could include the wildcard in that way
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

+ 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] SUMIFS using arrays
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2015, 05:51 AM
  2. Sumifs not calculating correctly
    By Sonal518 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-17-2015, 07:44 AM
  3. [SOLVED] Using Name Arrays as Criteria in SumProduct/SumIfs
    By stepscot in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-16-2014, 10:24 AM
  4. sumifs not adding up correctly
    By rrcrossman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-07-2013, 05:13 PM
  5. SUMIFS vs. arrays
    By djapigo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-30-2012, 01:39 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