+ Reply to Thread
Results 1 to 11 of 11

SUMIF with date criteria

  1. #1
    Registered User
    Join Date
    12-19-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 64-bit
    Posts
    11

    SUMIF with date criteria

    Hi

    Looking for some advice on how to develop an existing SUMIF formula which will also consider a specific/fixed date - hope someone can assist!!

    Please refer to the attached file (cmck_SUM.xlsx). I have created a SUMIF formula in column F ('Total Certificates') which will sum the quantity of certificates in column B (NoOfCertificates') depending on the 'Supplier' (Column E).

    However what I want to do is to exclude any certificates from the total in column F if 'NoOfCertificates' (column B) has a corresponding 'Start Date' (column C) which is before/prior to 01/04/2022. (where the date format is UK, DD/MM/YYYY).

    I should point out that the attached file is only a small sample - the file I need to create the formula for has thousands of rows, and columns E and F would probably reside on a different sheet but within the same .xlsx workbook. I've only added those columns here for illustration purposes

    Help on this would be very much appreciated!!!

    Cal
    Attached Files Attached Files
    Last edited by fingermouse; 03-28-2024 at 10:45 AM.

  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,869

    Re: SUMIF with date criteria

    Are you still using Excel 2010? If not, please update your profile whilst I have a look at this.
    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 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,869

    Re: SUMIF with date criteria

    You are using UNIQUE, so hopefully you have 365 (update your profile, please), which means you can try this in place of what you already have:

    =LET(u,TOCOL(DROP(UNIQUE(A:A),1),1),s,BYROW(u,LAMBDA(r,SUMIFS(B:B,A:A,r,C:C,"<"&DATE(2022,4,1)))),HSTACK(u,s))
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-19-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 64-bit
    Posts
    11

    Re: SUMIF with date criteria

    Thanks Ali!!! Have now updated, its been a while!!

  5. #5
    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,869

    Re: SUMIF with date criteria

    Or this to include titles:

    =LET(u,TOCOL(DROP(UNIQUE(A:A),1),1),s,BYROW(u,LAMBDA(r,SUMIFS(B:B,A:A,r,C:C,"<"&DATE(2022,4,1)))),t,{"Supplier","Sum"},VSTACK(t,HSTACK(u,s)))
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-19-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 64-bit
    Posts
    11

    Re: SUMIF with date criteria

    Hi Ali - many thanks for this!! When I place the formula into cell F2 it returns '#SPILL!'

  7. #7
    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,869

    Re: SUMIF with date criteria

    You have to delete EVERYTHING first so that there is room for the formula to spill - open the second workbook I attached. The formula goes into E1 once columns E and F are completely blank.

  8. #8
    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,869

    Re: SUMIF with date criteria

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  9. #9
    Registered User
    Join Date
    12-19-2013
    Location
    Scotland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 64-bit
    Posts
    11

    Re: SUMIF with date criteria

    Hi Ali - what I want the formula to do is EXCLUDE / NOT INCLUDE volumes which have a start date before 01/04/2022? I think your formula includes/ pulls them through rather than exclude?

    So the output in column F should be zero for all suppliers apart from supplier 2 (467) and Supplier 6 (1).

  10. #10
    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,869

    Re: SUMIF with date criteria

    OK - try this, then:

    =LET(u,TOCOL(DROP(UNIQUE(A:A),1),1),s,BYROW(u,LAMBDA(r,SUMIFS(B:B,A:A,r,C:C,">="&DATE(2022,4,1)))),t,{"Supplier","Sum"},VSTACK(t,HSTACK(u,s)))

    If this is what you want, please sign off the thread as explained in post #8.
    Attached Files Attached Files

  11. #11
    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,869

    Re: SUMIF with date criteria

    Thanks for the kind comment.

+ 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. SUMIF autofill date criteria
    By cktoo in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-15-2019, 07:35 PM
  2. [SOLVED] date format problem and SUMIF() is not working date criteria
    By majidsiddique in forum Excel General
    Replies: 6
    Last Post: 03-25-2019, 12:19 AM
  3. Sumif with criteria of date
    By candicevv in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2017, 12:29 AM
  4. SUMIF(S) with date criteria
    By jfs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-30-2014, 01:20 PM
  5. [SOLVED] SUMIF within date criteria?
    By loshington in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-24-2013, 10:45 AM
  6. Replies: 7
    Last Post: 10-08-2012, 01:53 AM
  7. SumIf using date criteria range and one other criteria
    By DJTMONEY in forum Excel General
    Replies: 1
    Last Post: 04-20-2010, 04:10 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