+ Reply to Thread
Results 1 to 8 of 8

Date Formula

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Date Formula

    Hi,

    My name is Andre and I am new to this forum.

    I would like some assistance to calculate the month by using 2 predefined dates.

    I need to run a report that calculates the begining of the month as the 3rd of every month and the end of the month on the 02nd of every month

    EG : 20110103 must be February (because the new month starts on the 03rd)
    20110204 must be March (because the new month starts on the 03rd)
    20110102 must be December (because the old month ends on the 02nd)

    Is this at all possible?

    Regards
    Andre.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Date Formula

    Welcome to excelforum, Andre

    Not sure I understand, wouldn't it be January that starts on 20110103? Are the dates in that format, what do you want the output to be, just the month as text or a date?
    Audere est facere

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Date Formula

    With the calendar date in A1:

    =IF(DAY(A1)<3,IF(MONTH(A1)-1=0,12,MONTH(A1)-1),MONTH(A1)) will give the report month.
    Gary's Student

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Date Formula

    Hello Jacobshavn,

    I was thinking of something along those lines but for the examples given, wouldn't your formula give January and February for the first two examples? Perhaps that's an error, though....

    If your suggestion works you could simplify with

    =MONTH(A1-2)

  5. #5
    Registered User
    Join Date
    10-15-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Date Formula

    @ daddylonglegs


    Hi Guys the first example worked thank you.
    Last edited by Cutter; 10-15-2012 at 05:19 PM. Reason: Removed whole post quote

  6. #6
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Date Formula

    Daddylonglegs:

    A superb simplification! (why didn't I think of that)

  7. #7
    Registered User
    Join Date
    10-15-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Date Formula

    And the second one thank you daddylonglegs

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Date Formula

    @ andrevw

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon 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)

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