+ Reply to Thread
Results 1 to 3 of 3

complex date function

  1. #1
    tjb
    Guest

    complex date function

    OK here's what I need:

    A user enters a date in A1, A2 should count number of full months between
    the date entered and the next September 1st. So if they enter 6/28/05 in A1,
    A2 should read with the number 2 (counting the months of July and August).
    If they enter 11/21/04 in A1, it should calculate to 9 and so on.

    If they enter a date in A1 that is the first of a month, then it should
    count that month as well. So if they enter 5/1/05 in A1, A2 should read 4.

    Of course this is possible but I can't seem to figure it out. Any
    suggestions?

  2. #2
    Bob Phillips
    Guest

    Re: complex date function

    =DATEDIF(A1,DATE(YEAR(TODAY())+(MONTH(TODAY())>8),9,1),"M")

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "tjb" <[email protected]> wrote in message
    news:[email protected]...
    > OK here's what I need:
    >
    > A user enters a date in A1, A2 should count number of full months between
    > the date entered and the next September 1st. So if they enter 6/28/05 in

    A1,
    > A2 should read with the number 2 (counting the months of July and August).
    > If they enter 11/21/04 in A1, it should calculate to 9 and so on.
    >
    > If they enter a date in A1 that is the first of a month, then it should
    > count that month as well. So if they enter 5/1/05 in A1, A2 should read

    4.
    >
    > Of course this is possible but I can't seem to figure it out. Any
    > suggestions?




  3. #3
    N Harkawat
    Guest

    RE: complex date function

    =DATEDIF(A1,DATE(2005,9,1),"m")

    "tjb" wrote:

    > OK here's what I need:
    >
    > A user enters a date in A1, A2 should count number of full months between
    > the date entered and the next September 1st. So if they enter 6/28/05 in A1,
    > A2 should read with the number 2 (counting the months of July and August).
    > If they enter 11/21/04 in A1, it should calculate to 9 and so on.
    >
    > If they enter a date in A1 that is the first of a month, then it should
    > count that month as well. So if they enter 5/1/05 in A1, A2 should read 4.
    >
    > Of course this is possible but I can't seem to figure it out. Any
    > suggestions?


+ 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