+ Reply to Thread
Results 1 to 13 of 13

sumifs with multiple criteria and date range year

  1. #1
    Registered User
    Join Date
    12-10-2010
    Location
    Singapore
    MS-Off Ver
    MS Excel for Mac 2011
    Posts
    51

    sumifs with multiple criteria and date range year

    BACKGROUND
    In cell F5 I use the following formula to summarize values based on two criteria:
    =SUMIFS(Input!$F:$F,Input!$B:$B,$D5,
    Input!$G:$G,$D$2,
    Input!$A:$A,">="&F$2,Input!$A:$A,"<"&G$2)


    EXPLANATION
    Input!$F:$F is a column with values
    Input!$B:$B is a column with range1
    D5 is criteria1 (that needs to match with criteria in the list Input!$B:$B with range1)
    Input!$G:$G is a column with range2
    D2 is criteria2 (that needs to match with criteria in the list Input!$G:$G with range2)
    Input!$A:$A is a column with dates (format: dd/mm/yyyy)
    F$2 and G$2 are (1st of the month) dates
    The formula works like a charm: it summarizes for the month, the values, matching the two criteria.

    REQUIREMENT
    In cell B5 I want to do the same (as in cell F5) but not for a month but for a year: summarize the values for a year, matching the two criteria.

    ISSUE
    The layout of the sheet doesn’t allow me to use the ">="&F$2 and "<"&R$2 elements. I would like to summarizes the values, matching the two criteria, for a year, isolating the year format in the date column (Input!$A:$A). The formula appears to have an error:

    =SUMIFS(Input!$F:$F,Input!$B:$B,$D5,
    Input!$G:$G,$D$2,
    "="YEAR(Input!$A:$A))


    Can anyone help me?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: sumifs with multiple criteria and date range year

    Will you please attach a sample Excel workbook? Nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

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

    Re: sumifs with multiple criteria and date range year

    The layout of the sheet doesn’t allow me to use the ">="&F$2 and "<"&R$2 elements
    Why not?
    Why can't R2 simply be a date that is 1 year from F2 ?

    Try
    =SUMIFS(Input!$F:$F,Input!$B:$B,$D5,
    Input!$G:$G,$D$2,
    Input!$A:$A,">="&F$2,Input!$A:$A,"<"&EDATE(F$2,12))

  4. #4
    Registered User
    Join Date
    12-10-2010
    Location
    Singapore
    MS-Off Ver
    MS Excel for Mac 2011
    Posts
    51

    Re: sumifs with multiple criteria and date range year

    Good morning Jonmo1; Thank you for your fast response. And it works, thanks!

    Yet, I was hoping for a solution that would accommodate my extended requirement. Whilst
    Column F-Q are the monthly values of 2016 and
    Column B the annual 2016 total,
    Column A and column C are the annual totals for 2015 and 2017 respectively.

    Whilst your formula works for cell B5, I don't have an idea how I can use your solution for A5 and C6. Do you have a suggestion?

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: sumifs with multiple criteria and date range year

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Registered User
    Join Date
    12-10-2010
    Location
    Singapore
    MS-Off Ver
    MS Excel for Mac 2011
    Posts
    51

    Re: sumifs with multiple criteria and date range year

    Thank you JohnTopley (and AliGW) for your guidance.

    Please find attached the sheet. I hope this clarifies my inquiry. Thank you in advance for the help,

    Gijs
    Attached Files Attached Files

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: sumifs with multiple criteria and date range year

    For get about formula, what do you want in B5 and why.
    If I ask you do it manually how do you do it. explain.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  8. #8
    Registered User
    Join Date
    12-10-2010
    Location
    Singapore
    MS-Off Ver
    MS Excel for Mac 2011
    Posts
    51

    Re: sumifs with multiple criteria and date range year

    Hi Siva, thank you for helping me. To your question, if I were to do it manually, I would:

    In sheet ‘Per month’ in cell B5
    sum the values in sheet ‘Input’ column F, based on the range1 YEAR (column A) and the range2 (column G),
    matching in sheet ‘Per month’ criteria1 (cell B2) and criteria2 (cell D2)

    In sheet ‘Per month’ in cell F5
    sum the values in sheet ‘Input’ column F, based on the range1 MONTH (column A) and the range2 (column G),
    matching in sheet ‘Per month’ criteria1 (cell F2) and criteria2 (cell D2)

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: sumifs with multiple criteria and date range year

    Try

    A3=SUMIFS(Input!$F:$F,Input!$A:$A,">="&DATE(B$2,1,1),Input!$A:$A,"<="&DATE(B$2,12,31),Input!$G:$G,$D$2,Input!$B:$B,$D3)

    copy across C column
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  10. #10
    Registered User
    Join Date
    12-10-2010
    Location
    Singapore
    MS-Off Ver
    MS Excel for Mac 2011
    Posts
    51

    Re: sumifs with multiple criteria and date range year

    Thank you shukla.ankur281190.

    1) I assume you mean I'm to put the formula in B3 (not A3)?
    2) I also assume I need to insert a column (D) and put 2018 in D2 to make the formula work for C3?

  11. #11
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: sumifs with multiple criteria and date range year

    It would take care for any year you just need to copy paste A5 and then drag towards the cell and down!! If you are inserting a new column for 2018 the same formula does take care.

  12. #12
    Registered User
    Join Date
    12-10-2010
    Location
    Singapore
    MS-Off Ver
    MS Excel for Mac 2011
    Posts
    51

    Re: sumifs with multiple criteria and date range year

    Quote Originally Posted by shukla.ankur281190 View Post
    Try

    A3=SUMIFS(Input!$F:$F,Input!$A:$A,">="&DATE(B$2,1,1),Input!$A:$A,"<="&DATE(B$2,12,31),Input!$G:$G,$D$2,Input!$B:$B,$D3)

    copy across C column
    I understand.

    To my other question: I assume I insert the formula in B3 (NOT A3 as you wrote earlier), before copying it across and down?

  13. #13
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: sumifs with multiple criteria and date range year

    Yes you should my mistake you should insert formula in B3 first then copy across.

+ 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: 3
    Last Post: 02-02-2017, 04:32 AM
  2. Replies: 5
    Last Post: 10-03-2016, 03:39 AM
  3. [SOLVED] Set Sumifs Criteria Range to equal year
    By HCLax in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2014, 09:53 AM
  4. [SOLVED] SUMIFS and Date Criteria (Month Year etc...) but without helper column?
    By JungleJme in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-16-2013, 07:21 AM
  5. Replies: 3
    Last Post: 11-21-2012, 04:57 PM
  6. [SOLVED] Use TEXT function as Criteria on Sumifs to convert month/year to date format
    By chico.corrales in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-08-2012, 07:49 PM
  7. 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