+ Reply to Thread
Results 1 to 7 of 7

How to sum values based on multiple array values?

  1. #1
    Registered User
    Join Date
    07-27-2015
    Location
    Aalborg, Denmark
    MS-Off Ver
    Excel 2019
    Posts
    32

    How to sum values based on multiple array values?

    Hi guys

    I hope you can help me make a nice solution for this one.

    In the enclosed spreadsheet I am trying to sum the total sum range of column B where the value in column A is equal to a value in column C.

    I can express this in a SUMIF function as such: =SUMIF(A:A;C:C;B:B). The only problem with this is that I have to drill down with the formula so that it checks each criteria cell. I would like for it to sum it up in total in cell I have picked for the formula (f2 in my spreadsheet).

    Maybe sumproduct could be of help but I have not been able to make it work...

    Do any of you guys know of an easy solution?

    Thanks in advance
    Kind regards
    Morten
    Attached Files Attached Files

  2. #2
    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
    44,098

    Re: How to sum values based on multiple array values?

    Hi. Try this:

    =SUMPRODUCT($B$2:$B$21*COUNTIF($C$2:$C$3,$A$2:$A$21))

    You may need ; instead of ,
    Attached Files Attached Files
    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

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: How to sum values based on multiple array values?

    Into F2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    array formulas, need CSE
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: How to sum values based on multiple array values?

    Another one

    =SUMPRODUCT(SUMIFS(B2:B21,A2:A21,C2:C3))

  5. #5
    Registered User
    Join Date
    07-27-2015
    Location
    Aalborg, Denmark
    MS-Off Ver
    Excel 2019
    Posts
    32

    Re: How to sum values based on multiple array values?

    Great @ Bo_Ry and Koksek - both works perfect! Thanks!
    Last edited by mortenhn; 01-30-2019 at 07:50 AM.

  6. #6
    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
    44,098

    Re: How to sum values based on multiple array values?

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  7. #7
    Registered User
    Join Date
    07-27-2015
    Location
    Aalborg, Denmark
    MS-Off Ver
    Excel 2019
    Posts
    32

    Re: How to sum values based on multiple array values?

    Quote Originally Posted by Glenn Kennedy View Post
    Hi. Try this:

    =SUMPRODUCT($B$2:$B$21*COUNTIF($C$2:$C$3,$A$2:$A$21))

    You may need ; instead of ,
    Thanks for the suggestion, but sadly this does not work for me as it multiplies the result according to the number of cells populated. Thanks anyways though

+ 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: 1
    Last Post: 12-09-2018, 10:32 AM
  2. Converting an array of data into multiple arrays based on a single column values
    By bjcowen9000 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2018, 01:13 PM
  3. Filter an array based on multiple cell values
    By Perplexed99 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-14-2018, 03:07 PM
  4. Replies: 5
    Last Post: 07-31-2018, 01:43 PM
  5. Index array list based on multiple matching Values
    By Jpidge20 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-13-2018, 09:13 PM
  6. Array formula to return multiple values based on various (OR) criteria
    By dancing-shadow in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-20-2013, 05:12 AM
  7. VBA.array to sum values based on multiple criterion and dates
    By Varmark in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2011, 09:33 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