+ Reply to Thread
Results 1 to 8 of 8

Add up values based on 2 criteria of which one is a date

  1. #1
    Registered User
    Join Date
    12-21-2017
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    365
    Posts
    15

    Add up values based on 2 criteria of which one is a date

    For various materials I have stock that has a certain expiration date. On a regular basis I need to check which have already expired, which will expire in 30 days, 60 days, etc.
    On top of the date, I have a quality setting. See below for an example:

    Now I like to see the total quantities of the materials that have an expiration date after or on 24-03-2025 but not later then 24-06-2025.
    The formula I have entered does not come back with the expected result.

    What am I doing wrong? Note I am not familiar with VBA.

    Thanks in advance for looking at my problem. Looking forward to a possible solution.
    Attached Files Attached Files
    Last edited by Marion59; 03-26-2025 at 06:24 AM. Reason: Adding attachment

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

    Re: Add up values based on 2 criteria of which one is a date

    Are you still using Excel 2010?

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,011

    Re: Add up values based on 2 criteria of which one is a date

    You need to do the date comparisons separately. One with >= and the other with <=.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    12-21-2017
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    365
    Posts
    15

    Re: Add up values based on 2 criteria of which one is a date

    Hi Ali, thanks for letting me know. I work with Office 365 and I will try to upload a sheet with relevant information.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,879

    Re: Add up values based on 2 criteria of which one is a date

    Please also update your forum profile.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,011

    Re: Add up values based on 2 criteria of which one is a date

    C21, copied across and down:
    PHP Code: 
    =SUMIFS($B$2:$B$15,$D$2:$D$15,$A21,$C$2:$C$15,">"&B$20,$C$2:$C$15,"<="&C$20

  7. #7
    Registered User
    Join Date
    12-21-2017
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    365
    Posts
    15

    Re: Add up values based on 2 criteria of which one is a date

    Dear TMS, thank you for the formula. It works like a charm. Many thanks.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,011

    Re: Add up values based on 2 criteria of which one is a date

    You're welcome.




    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to 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 those who helped.

+ 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. [SOLVED] Substract values based on date criteria
    By gvidic in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-17-2018, 06:21 AM
  2. [SOLVED] Return amount values based on date and name criteria
    By MyStix01 in forum Excel General
    Replies: 2
    Last Post: 10-09-2017, 09:26 PM
  3. Sum of unique values with mulitple criteria based on date :/
    By andylee1892 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-18-2017, 11:11 PM
  4. [SOLVED] Lookup and display values in order based on different date criteria.
    By sandman85 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-13-2014, 02:57 AM
  5. [SOLVED] difference of values based on date and criteria
    By darkhangelsk in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-28-2013, 03:06 PM
  6. [SOLVED] Would like to count cell values based on date criteria in a different range
    By sdavison in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-23-2013, 12:45 AM
  7. Remove duplicate values based on a date criteria
    By nomis6565 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-20-2013, 01:47 AM

Tags for this Thread

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