+ Reply to Thread
Results 1 to 5 of 5

Counting Number of Times Dates Appear In Excel Cell within Month/15DAYS/7DAYS

  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Counting Number of Times Dates Appear In Excel Cell within Month/15DAYS/7DAYS

    Hi Everyone,
    I have an excel column where each cell contains multiple dates and times separated by comma. I want to count how many dates are present within the last 30, 15 and 7 days repectively. Since today is 04-03-2018 so the last thirty dates should be counted with respect to that. Tommorow this date will change so solution should count the last thirty dates accordingly.

    I have attached the sample file where there are two sheets "BEFORE" and "AFTER" which will help you to understand the problem.

    Many thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Counting Number of Times Dates Appear In Excel Cell within Month/15DAYS/7DAYS

    You can use VBA to get the desired output easily without any complex array formula.

    Place the following code on a Standard Module and then use it on the sheet like below...
    Please Login or Register  to view this content.
    and then copy it across and down.

    Please note that the cells B1:D1 are custom formatted as "Last "General" Days" so that 30 in B1 will display as "Last 30 Days" etc.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Counting Number of Times Dates Appear In Excel Cell within Month/15DAYS/7DAYS

    Hi,
    Thanks for helping me out. I have some quick questions about this solution as I am not excel expert so:

    1) Does this VBA Work as the current date changes on my PC daily? Would the results update itself automatically with respect to current date?
    2) What if the data (Dates) is present in some other column lets say E.G column I, would that code work accordingly?
    3) I don't understand this point "Please note that the cells B1:D1 are custom formatted as "Last "General" Days" so that 30 in B1 will display as "Last 30 Days" etc." . What do you mean by that?
    Last edited by AliGW; 03-04-2018 at 08:57 AM. Reason: Unnecessary quotation removed.

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

    Re: Counting Number of Times Dates Appear In Excel Cell within Month/15DAYS/7DAYS

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    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.

  5. #5
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Counting Number of Times Dates Appear In Excel Cell within Month/15DAYS/7DAYS

    Okay. I will keep that in mind.

+ 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] Counting number of times a specific month appears in an entire column
    By mhewitson15 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-22-2014, 07:43 PM
  2. Counting the number of times a month appears in a list
    By john dalton in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-16-2013, 12:48 PM
  3. Counting number of unique dates per month in a list of duplicate dates
    By Rackle83 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-22-2013, 10:15 AM
  4. Counting the number of times a month appears
    By Kololo in forum Excel General
    Replies: 3
    Last Post: 02-24-2012, 10:29 PM
  5. Replies: 2
    Last Post: 10-28-2010, 12:07 PM
  6. Counting number of times a cell reference appears in a 12 month period
    By Alistar3000 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-23-2010, 04:52 PM
  7. counting the number of times something is bought during a month
    By ldd in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2005, 03:25 PM

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