+ Reply to Thread
Results 1 to 7 of 7

How to add date format into if statement?

  1. #1
    Eric
    Guest

    How to add date format into if statement?

    Does anyone know how to add date format into if statement? such as
    If(A1="1-Mar-2005", 1,0)
    Thank you
    Eric

  2. #2
    Karthik
    Guest

    RE: How to add date format into if statement?

    Hi Eric,

    Maybe you could try putting the date in a separate cell and giving a cell
    reference to this one in the IF function. Hope this works!

    Regards,
    Karthik

    "Eric" wrote:

    > Does anyone know how to add date format into if statement? such as
    > If(A1="1-Mar-2005", 1,0)
    > Thank you
    > Eric


  3. #3
    Eric
    Guest

    RE: How to add date format into if statement?

    Thank Karthik for your reply,

    I forget to describe the condition.
    I want to determine whether the day and month only are within certain period?
    such as
    If "10-Mar-2005" is between "1-Mar" and "14-May" and ignore the year, then
    return 1, else return 0.
    Reture value should be 1 in this case.
    Do you have any idea?
    Thank you
    Eric


    "Karthik" wrote:

    > Hi Eric,
    >
    > Maybe you could try putting the date in a separate cell and giving a cell
    > reference to this one in the IF function. Hope this works!
    >
    > Regards,
    > Karthik
    >
    > "Eric" wrote:
    >
    > > Does anyone know how to add date format into if statement? such as
    > > If(A1="1-Mar-2005", 1,0)
    > > Thank you
    > > Eric


  4. #4
    Bob Phillips
    Guest

    Re: How to add date format into if statement?

    =IF(A1=--"2005-03-01,1,0)

    or

    =IF(A1=DATE(2005,03,01),1,0)

    or

    =IF(A1=DATEVALUE("1-Mar-2005"),1,0)

    --

    HTH

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


    "Eric" <[email protected]> wrote in message
    news:[email protected]...
    > Does anyone know how to add date format into if statement? such as
    > If(A1="1-Mar-2005", 1,0)
    > Thank you
    > Eric




  5. #5
    Bob Phillips
    Guest

    Re: How to add date format into if statement?



    --

    HTH

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


    "Eric" <[email protected]> wrote in message
    news:[email protected]...
    > Thank Karthik for your reply,
    >
    > I forget to describe the condition.
    > I want to determine whether the day and month only are within certain

    period?
    > such as
    > If "10-Mar-2005" is between "1-Mar" and "14-May" and ignore the year, then
    > return 1, else return 0.
    > Reture value should be 1 in this case.
    > Do you have any idea?
    > Thank you
    > Eric
    >
    >
    > "Karthik" wrote:
    >
    > > Hi Eric,
    > >
    > > Maybe you could try putting the date in a separate cell and giving a

    cell
    > > reference to this one in the IF function. Hope this works!
    > >
    > > Regards,
    > > Karthik
    > >
    > > "Eric" wrote:
    > >
    > > > Does anyone know how to add date format into if statement? such as
    > > > If(A1="1-Mar-2005", 1,0)
    > > > Thank you
    > > > Eric




  6. #6
    Bob Phillips
    Guest

    Re: How to add date format into if statement?


    =IF(AND(DATE(YEAR(TODAY()),MONTH(A1),DAY(A1))>=DATEVALUE("01-Mar-"&YEAR(TODA
    Y())),DATE(YEAR(TODAY()),MONTH(A1),DAY(A1))<=DATEVALUE("14-May"&YEAR(TODAY()
    ))),1,0)


    --

    HTH

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


    "Eric" <[email protected]> wrote in message
    news:[email protected]...
    > Thank Karthik for your reply,
    >
    > I forget to describe the condition.
    > I want to determine whether the day and month only are within certain

    period?
    > such as
    > If "10-Mar-2005" is between "1-Mar" and "14-May" and ignore the year, then
    > return 1, else return 0.
    > Reture value should be 1 in this case.
    > Do you have any idea?
    > Thank you
    > Eric
    >
    >
    > "Karthik" wrote:
    >
    > > Hi Eric,
    > >
    > > Maybe you could try putting the date in a separate cell and giving a

    cell
    > > reference to this one in the IF function. Hope this works!
    > >
    > > Regards,
    > > Karthik
    > >
    > > "Eric" wrote:
    > >
    > > > Does anyone know how to add date format into if statement? such as
    > > > If(A1="1-Mar-2005", 1,0)
    > > > Thank you
    > > > Eric




  7. #7
    Eric
    Guest

    Re: How to add date format into if statement?

    Thank everyone very much
    Eric

+ 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