+ Reply to Thread
Results 1 to 7 of 7

Sumifs with multiple criteria and sumranges

  1. #1
    Registered User
    Join Date
    01-02-2014
    Location
    Los Angeles
    MS-Off Ver
    Excel 2013
    Posts
    14

    Sumifs with multiple criteria and sumranges

    Hi guys,

    I need your help with the Sumifs function. Please see the attached example. What I am trying to do is depending on what period it is, have my sumifs function add up more than one sumrange. For example, if the current period is 3, sum columns containing Period 1, Period 2, and Period 3 (three separate columns) and use multiple criteria, for example, do this for dept 150 and cost category Admin. I am sure there is a way to do this but can't yet figure it out. I can only do sumifs with the offset function for any one period.

    Thank you
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-30-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Sumifs with multiple criteria and sumranges

    Hi,

    Take a look at my solution. I had to calculate your result in two steps, first using the choose function and then using a sumifs.

    David
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-02-2014
    Location
    Los Angeles
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Sumifs with multiple criteria and sumranges

    Thanks David, I guess I can also do sum(offset(...)) but I am curious if there is a way to do it in one step.

  4. #4
    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
    53,049

    Re: Sumifs with multiple criteria and sumranges

    Try this...
    =SUMPRODUCT(($A$4:$A$16="Admin")*($B$4:$B$16=150)*(OFFSET($D$4,0,0,13,B18)))
    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

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,885

    Re: Sumifs with multiple criteria and sumranges

    Here are three different solutions. The last one is what you are after I guess.
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sumifs with multiple criteria and sumranges

    Here's another one...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    3
    Category
    Department
    Account
    Jul
    Aug
    Sep
    Oct
    4
    Consulting
    340
    84100
    $3,240
    $3,240
    $3,240
    $3,240
    5
    Admin
    150
    55000
    $1,215
    $1,215
    $1,215
    $1,215
    6
    Consulting
    250
    89000
    $17,500
    $0
    $0
    $0
    7
    Consulting
    150
    83250
    $5,953
    $5,953
    $5,953
    $5,953
    8
    Admin
    150
    51210
    $1,287
    $1,287
    $1,287
    $1,287
    9
    Consulting
    160
    87000
    $145
    $145
    $145
    $145
    10
    Admin
    120
    51410
    $281
    $281
    $281
    $281
    11
    Consulting
    150
    88654
    $660
    $660
    $660
    $660
    12
    Admin
    150
    51110
    $5,953
    $5,953
    $5,953
    $5,953
    13
    T&M
    180
    61600
    $1,287
    $1,287
    $1,287
    $1,287
    14
    Admin
    150
    51310
    $145
    $145
    $145
    $145
    15
    T&M
    280
    61400
    $281
    $281
    $281
    $281
    16
    Admin
    150
    51510
    $660
    $660
    $660
    $660
    17
    18
    Current Period
    3
    27777.83
    19
    Category
    Admin
    20
    Dept
    150


    This array formula** entered in C18:

    =SUM(IF(A4:A16=B19,IF(B4:B16=B20,D4:INDEX(D4:G16,0,B18))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    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
    53,049

    Re: Sumifs with multiple criteria and sumranges

    Stealing from Tony (the last part), try this normal formula...
    =SUMPRODUCT(($A$4:$A$16="Admin")*($B$4:$B$16=150)*(D4:INDEX(D4:G16,0,B18)))

+ 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. SumIfs with multiple criteria using VBA
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-04-2013, 10:21 AM
  2. Sum on Multiple Criteria WITHOUT using SUMIFS
    By loginjmor in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-08-2013, 11:10 AM
  3. Replies: 2
    Last Post: 01-23-2013, 06:25 AM
  4. Replies: 3
    Last Post: 11-21-2012, 04:57 PM
  5. Replies: 1
    Last Post: 05-16-2011, 05:00 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