+ Reply to Thread
Results 1 to 3 of 3

Conditional sum on an array

  1. #1
    Registered User
    Join Date
    08-31-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Conditional sum on an array

    Hi,
    I'm facing a problem that I thought would be simple. I'm trying to sum an array based on two conditions which sumif won't do. Here's an example
    Apple Apple Banana Apple
    Team1 1 1 1 1
    Team1 1 1 1 1
    Team2 1 1 1 1
    Team3 1 1 1 1

    So what I want to do is sum the 4x4 grid of '1's if the column is "apple" and if the Team is Team1.
    I tried sumifs but it doesn't like the 4x4 array.
    Any suggestions?
    Thanks in advance,
    Jeff

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Conditional sum on an array

    Hello,

    That's what Sumproduct does to perfection:

    =SUMPRODUCT((A2:A5="Team1")*(B1:E1="Apple")*B2:E5)

    cheers,

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Conditional sum on an array

    Hi Jeff and welcome to the forum,

    If you had your data in what Excel calls a Table you could do a Pivot Table on it to get lots of these answers.

    see the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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