+ Reply to Thread
Results 1 to 3 of 3

Time Calculation

  1. #1
    Issam LAdki
    Guest

    Time Calculation

    Can somebody help please.
    I am trying to enter this formula but something does not seem to work.

    Cell C2 containes a time data in the format HH:MM:SS
    i am trying to enter in cell D2 the following formula:
    =IF(C2=03:30:00,"ABC",(C2=04:30:00,"DEF",(C2=05:30:00,"GHI","FL")))

    This does not seem to work with time, though it does work with general
    numbers.

    Thanks in advance



  2. #2
    Niek Otten
    Guest

    Re: Time Calculation

    =IF(C2=TIME(3,30,0),"ABC",(IF(C2=TIME(4,30,0),"DEF",(IF(C2=TIME(5,30,0),"GHI","FL")))))

    If C2 is the result of a calculation, be aware that if it is off only
    1/100000 of a second, your comparisons will not evaluate to TRUE

    --

    Kind Regards,

    Niek Otten

    Microsoft MVP - Excel

    "Issam LAdki" <[email protected]> wrote in message
    news:[email protected]...
    > Can somebody help please.
    > I am trying to enter this formula but something does not seem to work.
    >
    > Cell C2 containes a time data in the format HH:MM:SS
    > i am trying to enter in cell D2 the following formula:
    > =IF(C2=03:30:00,"ABC",(C2=04:30:00,"DEF",(C2=05:30:00,"GHI","FL")))
    >
    > This does not seem to work with time, though it does work with general
    > numbers.
    >
    > Thanks in advance
    >
    >




  3. #3
    Biff
    Guest

    Time Calculation

    Hi!

    Try this:

    =IF(C2=TIME(3,30,0),"ABC",IF(C2=TIME(4,30,0),"DEF",IF
    (C2=TIME(5,30,0),"GHI","FL")))

    If C2 is any other value but 3:30, 4:30 or 5:30, the
    formula will return FL. That also means if cell C2 is
    empty. Are you sure that's what you really want?

    If C2 is empty you more than likely don't want FL to be
    returned, so:

    =IF(C2="","",IF(C2=TIME(3,30,0),"ABC",IF(C2=TIME
    (4,30,0),"DEF",IF(C2=TIME(5,30,0),"GHI","FL"))))

    If you have a whole bunch of these it may be better to use
    a lookup.

    Biff

    >-----Original Message-----
    >Can somebody help please.
    >I am trying to enter this formula but something does not

    seem to work.
    >
    >Cell C2 containes a time data in the format HH:MM:SS
    >i am trying to enter in cell D2 the following formula:
    >=IF(C2=03:30:00,"ABC",(C2=04:30:00,"DEF",

    (C2=05:30:00,"GHI","FL")))
    >
    >This does not seem to work with time, though it does work

    with general
    >numbers.
    >
    >Thanks in advance
    >
    >
    >.
    >


+ 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