+ Reply to Thread
Results 1 to 10 of 10

Count dates that have expired or due to within 1 month, 3 months etc

  1. #1
    Registered User
    Join Date
    01-17-2018
    Location
    Cambridge, England
    MS-Off Ver
    2010
    Posts
    3

    Count dates that have expired or due to within 1 month, 3 months etc

    Hello, wondering if anyone could help?

    I have a table containing dates detailing when certificates for various things expire for different locations and need to separately count the amount before todays date (expired), any within 30 days, then 90 days, then 180 days.

    So

    ... Expired
    ... Expires within 1 month
    ... Expires within 3 months
    ... Expires within 6 months

    I've managed to do the expired bit using =COUNTIF(B1:B35,"<"&TODAY()) but I'm struggling to do the rest no matter how many different variants I've used from looking at websites online. I'm using =COUNTIF(B2:B35,"<"&TODAY()+30) which feels like its working but for some reason it's producing odd results and I don't really understand why. And when I try the same with 90 days it's giving the wrong numbers aswell.

    Am I on the right track? Can any one help?

    Thanks!

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,598

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    Welcome to the forum!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and 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 results are 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
    Registered User
    Join Date
    01-17-2018
    Location
    Cambridge, England
    MS-Off Ver
    2010
    Posts
    3

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    Hi here is a representative workbook to make things clearer hopefully.

    Ideally I'd also like to conditionally format the dates to turn red, orange, etc if anyone can help with that on the sheet provided as well but I don't want to be cheeky!

    Thanks,
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    Formulas:
    B21 =COUNTIF(B2:B13,"<"&TODAY()+30)-B20
    B22 =COUNTIF(B2:B13,"<"&TODAY()+90)-B20-B21
    B23 =COUNTIF(B2:B14,"<"&TODAY()+180)-B20-B21-B22

    Copy across to other columns.
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  5. #5
    Registered User
    Join Date
    01-17-2018
    Location
    Cambridge, England
    MS-Off Ver
    2010
    Posts
    3

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    Thank you that's perfect. Not sure how to add reputation and mark thread as solved I'll have to find out at lunch as I'm at work!

    Thanks!

  6. #6
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,598

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Registered User
    Join Date
    05-28-2010
    Location
    London
    MS-Off Ver
    MS365 (PC) Version 2301
    Posts
    87

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    Morning - I've been hunting to find a solution to my similar issue;

    I've columns of dates and I want to be able to count, in one cell, how many dates are within 30 days of (prior to) today's date and/or have "expired" and on or past today's date

    I've tried the above and many more but struggling! I just can't work out the final piece to the jigsaw

    Any help is always appreciated! Book6.xlsx
    Last edited by Wilgoss; 04-15-2023 at 02:21 AM.

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

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    Quote Originally Posted by Wilgoss View Post
    Morning - I've been hunting to find a solution to my similar issue;

    I've columns of dates and I want to be able to count, in one cell, how many dates are within 30 days of (prior to) today's date and/or have "expired" and on or past today's date

    I've tried the above and many more but struggling! I just can't work out the final piece to the jigsaw

    Any help is always appreciated! Attachment 825796
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    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

  9. #9
    Registered User
    Join Date
    05-28-2010
    Location
    London
    MS-Off Ver
    MS365 (PC) Version 2301
    Posts
    87

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    Quote Originally Posted by FDibbins View Post
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Thanks - yes, familiar and I would have created a new thread but it was telling me yesterday that I couldn't post a new thread..today, different story so I will do! Cheers

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

    Re: Count dates that have expired or due to within 1 month, 3 months etc

    Ok thanks for understanding

+ 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] Formula to show number of months (1st and last month inclusive) between 2 dates
    By antmcg12 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 12-17-2020, 04:46 PM
  2. Count how many dates are this month, 2 months and 3 months old
    By jimmisavage in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2017, 09:21 AM
  3. [SOLVED] Count of months against current month
    By JCStewartNZ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-01-2015, 06:37 AM
  4. Replies: 2
    Last Post: 06-21-2012, 08:17 PM
  5. Rounding Dates up to the last day of the month & adding 11 months
    By EPeterson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-12-2011, 07:57 PM
  6. Count Months Between Dates
    By jpgoeth in forum Excel General
    Replies: 3
    Last Post: 05-31-2007, 12:17 PM
  7. Counting dates for a the present month but not future months
    By BrianInCalifornia in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-06-2005, 10:15 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