+ Reply to Thread
Results 1 to 6 of 6

Multiple Sums - SUMIFS? SUMPRODUCT?

  1. #1
    Registered User
    Join Date
    07-07-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    2010
    Posts
    68

    Question Multiple Sums - SUMIFS? SUMPRODUCT?

    Hi All,
    I am creating a dashboard to show data from a separate tab if it meets a few different criteria.
    Basically the SubProject has to meet one or two criteria (first 3 digits are 230 or 280, or last 4 digits are 3380...) AND the month has to equal 4 (for April...) I am trying to display a sum by month on the cover page (dashboard).

    For those who this problem sounds familiar to, yes I have posted varying degrees of difficulty on this same dashboard - the 'higher ups' keep changing their mind as to what is the most important to see.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Multiple Sums - SUMIFS? SUMPRODUCT?

    I seem to be missing a few pieces here. Are you trying to sum up the data from the budget entry page? If so, how are you getting any numbers for April since there is no data for April? Also how do you know what the capital items are? Is there some sort of table that connects subproject with the breakout into capital item?

    The solution I would pick would be SUMPRODUCT because you can use wildcards (SUMIFS will let you do this too) but you have a bit more flexibility in the logic. It turns out that your data is numeric so wildcards wont work. Given the data you do have I concocted a formula:

    =SUMPRODUCT((N3:N25)*(M3:M25=11)*( (INT(E3:E25/100000)=27 ) + (INT(E3:E25/100000)=21 )))

    With SUMPRODUCT multiplication (*) is like an AND statement and addition (+) is like an OR statement. So the above reads:

    Sum the quantity where month is 11 and (code starts with 21 or 27).

    SUMPRODUCT is an array formula in disguise even though it is not entered like one, so you can get away with doing operations on ranges like INT(Range/100000). It's as if you took each cell in the range and applied the formula to it.
    Attached Files Attached Files
    Last edited by dflak; 09-15-2016 at 04:55 PM.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    07-07-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    2010
    Posts
    68

    Re: Multiple Sums - SUMIFS? SUMPRODUCT?

    Thanks, I am new to SUMPRODUCT and am not sure hat some of the "array" work
    Are you able to tell me what this is asking:
    ( (INT(E3:E25/100000)=27 ) + (INT(E3:E25/100000)=21 )))

    In answer to your question I know April has no data - it was the first month of the project so nothing happened until May.
    I do have a subproject coding reference, I have just used dummy data for the example as a lot of my data is not for public.

    Basically my formula works to return the subproject data, but when I add the month I get an Error Message.
    SUMPRODUCT('Budget Entry 16 17'!R:R,(LEFT('Budget Entry 16 17'!G:G,3)=230)+(LEFT('Budget Entry 16 17'!G:G,3)=280)*('Budget Entry 16 17'!O:O=4))
    *('Budget Entry 16 17'!O:O=4)) is the part where I am trying to add the month - Column O has the month number in it and on my dashboard Row 3 Column W also has the month number - I am not sure if I should put =4 or =W3 I have tried both and they do not work.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Multiple Sums - SUMIFS? SUMPRODUCT?

    Quote Originally Posted by 1Stacy View Post
    Are you able to tell me what this is asking:
    ( (INT(E3:E25/100000)=27 ) + (INT(E3:E25/100000)=21 )))
    The INT(E3:E25/100000) takes each cell in the range E3:E25 and divides it by 100,000 and then takes whatever the integer part is. For example if the cell contained 2712345, it would be converted to 27.12345 and INT(27.12345) is 27.

    The formula doesn't actually change the cell contents, but it holds the computations in an array internally.

    I suppose I could also have used LEFT(E3:E25,2).

    As for the + and * operators. * acts like AND and + works like OR. So suppose we manufactured balloons of various colors and in three sizes and we wanted to know how many large red balloons and large blue balloons we sold.

    You could use =SUMPRODUCT ((Size="Large")*(Color="RED")) + SUMPRODUCT ((Size="Large")*(Color="BLUE"))
    or you could use
    =SUMPRODCUT ((Size="Large") * ( (Color="RED") + (Color="BLUE") ) )

    To get a better idea how array arithmetic works, see this article: http://www.utteraccess.com/wiki/inde...Array_Formulas.

  5. #5
    Registered User
    Join Date
    07-07-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    2010
    Posts
    68

    Re: Multiple Sums - SUMIFS? SUMPRODUCT?

    Thanks, the link helps as I am trying to learn this one!
    I entered this:
    =SUMPRODUCT(('Budget Entry 16 17'!R:R)*('Budget Entry 16 17'!O:O=4)*((INT('Budget Entry 16 17'!G:G/100000)=28 )+(INT('Budget Entry 16 17'!G:G/100000)=23 )))
    But I got a Value
    So I edited:
    =SUMPRODUCT(('Budget Entry 16 17'!R2:R600)*('Budget Entry 16 17'!O2:O600=5)*((INT('Budget Entry 16 17'!G2:G600/100000)=28 )+(INT('Budget Entry 16 17'!G2:G600/100000)=23)))
    And it is working!

    Thanks!

  6. #6
    Registered User
    Join Date
    07-07-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    2010
    Posts
    68

    Re: Multiple Sums - SUMIFS? SUMPRODUCT?

    I am having trouble with one of the other formulas - I am still trying to do the same thing, except this time I want to use the Left(G2:G600,3)="210" + Left(G2:G600, 3)="220" but it does not seem to be working
    I have a lot of SubProject codes that begin with 210 or 220 that will be used for this cost centre, will INT still work?
    I am trying:
    =SUMPRODUCT(('Budget Entry 16 17'!$R$2:$R$600)*('Budget Entry 16 17'!$O$2:$O$600=4))*((LEFT('Budget Entry 16 17'!$G$2:$G$600,3)="210"))+(LEFT('Budget Entry 16 17'!$G$2:$G$600,3)="220")
    OK so:
    =SUMPRODUCT(('Budget Entry 16 17'!$R$2:$R$600)*('Budget Entry 16 17'!$O$2:$O$600=4)*((INT('Budget Entry 16 17'!$G$2:$G$600/100000)=22 )+(INT('Budget Entry 16 17'!$G$2:$G$600/100000)=21)))
    Worked!

    dflak - thanks for all of your help, I just like to post the answer that worked for others who might be reading or searching this can see what worked in the end!
    Last edited by 1Stacy; 09-16-2016 at 02:16 PM. Reason: Added 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. Sumproduct for ranking with multiple criterias; maybe sumifs?
    By myth_victor in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-09-2015, 10:44 AM
  2. Replies: 5
    Last Post: 02-06-2015, 08:44 PM
  3. SUMIFs across multiple columns (SUMPRODUCT?)
    By source in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 01-26-2015, 02:39 PM
  4. [SOLVED] Sumifs or Sumproduct With Multiple Conditions Help Please!
    By geepee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-01-2013, 09:27 AM
  5. Multiple conditions - SumProduct, SumIfs, CountIfs - Which do I need?
    By Carcophan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2013, 01:43 PM
  6. Replies: 2
    Last Post: 01-23-2013, 06:25 AM
  7. [SOLVED] sumproduct and sumifs using multiple criteria across worksheets
    By mick86 in forum Excel General
    Replies: 4
    Last Post: 08-29-2012, 02:51 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