+ Reply to Thread
Results 1 to 8 of 8

Test date to see if it is the end of a month

  1. #1
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    244

    Test date to see if it is the end of a month

    ***I'm using Excel 2003***

    I have a particular cell in each worksheet (A1) that has the date of a transaction in dd/mm/yy format. In another cell (B1), I need to test the date in A1 to see if it is the end of a month and return which month it is. But, to complicate things, the dates in A1 are only workdays, so in theory the true end of month could fall on a weekend, but I need the prior Friday to show-up as end of month.

    Thanks in advance.
    Last edited by Big.Moe; 04-28-2015 at 11:11 PM.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Test date to see if it is the end of a month

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    if you cant get EOMONTH doesnt work
    http://excel.tips.net/T002810_Using_..._Function.html

    follow guide in link to get it working
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    244

    Re: Test date to see if it is the end of a month

    Thanks so much for that quick reply.

    That worked perfectly for how I worded my question, but after seeing the results, I realized I worded my question slightly wrong. Your formula returns the end of month for all dates, what I need is to return the end of month only if the date being tested is in fact the last workday of that month. So for example, as I am nearing the end of month, the return from the formula would be "0", but when it hits the last workday then it would return the end of the month.

    My apologies for the miscommunication.
    Last edited by Big.Moe; 04-28-2015 at 09:50 PM.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Test date to see if it is the end of a month

    uummm

    so within 7 days of eomonth make the formula go ahead?

    actually...would 5 be more correct?
    Last edited by humdingaling; 04-28-2015 at 09:57 PM.

  5. #5
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    244

    Re: Test date to see if it is the end of a month

    Let me use some real examples:

    April
    For April 1st through April 29th the formula would return a "0", but if A1 contained the date 4/30/15, then it would recognize that cell as the end of the month.

    May
    For May 1st through May 28th the formula would return a "0", but if A1 contained the date 5/29/15, then it would recognize that cell as the end of the month since it is the last workday of May (30 & 31 fall on a weekend).

    I hope that clarifies things.

  6. #6
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    244

    Re: Test date to see if it is the end of a month

    I think I have part of the solution which tests for the last day of the month:

    Please Login or Register  to view this content.
    Now I just need help to test for the last workday of the month.

  7. #7
    Forum Contributor Big.Moe's Avatar
    Join Date
    03-15-2012
    Location
    Corea, Maine, USA
    MS-Off Ver
    Excel 2010
    Posts
    244

    Re: Test date to see if it is the end of a month

    Well, I surprised myself. I think this formula does the trick. Not sure if it is the most efficient, but it seems to work:

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Test date to see if it is the end of a month

    as long as it works for you

    you could just replace that date bit with EOMONTH
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by humdingaling; 04-28-2015 at 11:17 PM.

+ 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. Sort month/date/year data using month and date only
    By SMW820 in forum Excel General
    Replies: 8
    Last Post: 11-18-2014, 08:39 AM
  2. How can i show date in this form (month,last date of that month, Year)?
    By vjharry in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-24-2014, 04:39 AM
  3. [SOLVED] Date function- 1st day of month for 2nd full month from start date
    By vidiotdave in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-25-2014, 05:33 AM
  4. Array function for date(month), Range Date(month)
    By dluhut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-19-2013, 05:14 PM
  5. [SOLVED] Date arithmetic: adding 1 month to prior end of month date
    By manxman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-14-2006, 04:35 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