+ Reply to Thread
Results 1 to 6 of 6

ingnoring day in date frmat

  1. #1
    Registered User
    Join Date
    02-16-2005
    Posts
    19

    ingnoring day in date frmat

    hi all

    i am trying to use the conditional formating by comparing two cells, both are date formated but one is may-1-06 and the othe is may-9-06, i would like to compare only the month and year, it sould not matter what day of the month, so the above date should match in my conditional formation.

    mybe there is a way to change all the days in all the dates to be the same, like the first of the month.

    any idea, VB solution .

    thank you all.
    marwan

  2. #2
    Steve Yandl
    Guest

    Re: ingnoring day in date frmat

    If you have a date in A1,
    =DATE(YEAR(A1),MONTH(A1),1)
    should return the date for the first of the month for the month and year the
    date in A1 represents.

    Steve


    "mostakimm" <[email protected]> wrote in
    message news:[email protected]...
    >
    > hi all
    >
    > i am trying to use the conditional formating by comparing two cells,
    > both are date formated but one is *may-1-06* and the othe is
    > *may-9-06*, i would like to compare only the month and year, it sould
    > not matter what day of the month, so the above date should match in my
    > conditional formation.
    >
    > mybe there is a way to change all the -days- in all the dates to be
    > the same, like the first of the month.
    >
    > any idea, VB solution .
    >
    > thank you all.
    > marwan
    >
    >
    > --
    > mostakimm
    > ------------------------------------------------------------------------
    > mostakimm's Profile:
    > http://www.excelforum.com/member.php...o&userid=20025
    > View this thread: http://www.excelforum.com/showthread...hreadid=499482
    >




  3. #3
    Dave Peterson
    Guest

    Re: ingnoring day in date frmat

    Maybe you can use something like:

    =TEXT(A1,"yyyymm")=TEXT(B1,"yyyymm")

    in your conditional formatting formula.

    mostakimm wrote:
    >
    > hi all
    >
    > i am trying to use the conditional formating by comparing two cells,
    > both are date formated but one is *may-1-06* and the othe is
    > *may-9-06*, i would like to compare only the month and year, it sould
    > not matter what day of the month, so the above date should match in my
    > conditional formation.
    >
    > mybe there is a way to change all the -days- in all the dates to be
    > the same, like the first of the month.
    >
    > any idea, VB solution .
    >
    > thank you all.
    > marwan
    >
    > --
    > mostakimm
    > ------------------------------------------------------------------------
    > mostakimm's Profile: http://www.excelforum.com/member.php...o&userid=20025
    > View this thread: http://www.excelforum.com/showthread...hreadid=499482


    --

    Dave Peterson

  4. #4
    Registered User
    Join Date
    01-04-2006
    Posts
    33
    If you use this it will give you the number of months between the 2 dates and you could use this number foir conditional formating
    =DATEDIF(A1,B1,"ym")

  5. #5
    Registered User
    Join Date
    01-04-2006
    Posts
    33
    Sorry should have been =DATEDIF(A1,B1,"m")

  6. #6
    Registered User
    Join Date
    02-16-2005
    Posts
    19

    great

    Thnk you all for the great help

+ 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