+ Reply to Thread
Results 1 to 6 of 6

Formals with IF and Then

  1. #1
    Cyrus
    Guest

    Formals with IF and Then

    I need help with a formula. I'm creating a spreadsheet where data entry
    would indicate the time a patient arrives and than leaves. I need a formula
    that calculates this, but displays nothing if no time is entered (for example
    down the worksheet).

    =IF((M2-L2)=0,""),IF((M2-L2)>0,"h:mm")

    This is what I have...I keep getting value error.

    i want the time to display if the time is greater than zero, but if less
    than zero, display nothing.

    Thanks,

    Cyrus

  2. #2
    Bob Phillips
    Guest

    Re: Formals with IF and Then

    Maybe

    =IF(OR(M2="",L2=""),"",IF(M2-L2>0,M2-L2,""))


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Cyrus" <Cyrus@discussions.microsoft.com> wrote in message
    news:32F8E5D1-0BE5-42EB-B3AA-21DE9E6FA37F@microsoft.com...
    > I need help with a formula. I'm creating a spreadsheet where data entry
    > would indicate the time a patient arrives and than leaves. I need a

    formula
    > that calculates this, but displays nothing if no time is entered (for

    example
    > down the worksheet).
    >
    > =IF((M2-L2)=0,""),IF((M2-L2)>0,"h:mm")
    >
    > This is what I have...I keep getting value error.
    >
    > i want the time to display if the time is greater than zero, but if less
    > than zero, display nothing.
    >
    > Thanks,
    >
    > Cyrus




  3. #3
    CLR
    Guest

    RE: Formals with IF and Then

    =TEXT(IF(M2-L2>0,M2-L2,""),"h:mm")

    Vaya con Dios,
    Chuck, CABGx3



    "Cyrus" wrote:

    > I need help with a formula. I'm creating a spreadsheet where data entry
    > would indicate the time a patient arrives and than leaves. I need a formula
    > that calculates this, but displays nothing if no time is entered (for example
    > down the worksheet).
    >
    > =IF((M2-L2)=0,""),IF((M2-L2)>0,"h:mm")
    >
    > This is what I have...I keep getting value error.
    >
    > i want the time to display if the time is greater than zero, but if less
    > than zero, display nothing.
    >
    > Thanks,
    >
    > Cyrus


  4. #4
    Sloth
    Guest

    RE: Formals with IF and Then

    =TEXT(MAX(M2-L2,0),"h:mm;;")


    "Cyrus" wrote:

    > I need help with a formula. I'm creating a spreadsheet where data entry
    > would indicate the time a patient arrives and than leaves. I need a formula
    > that calculates this, but displays nothing if no time is entered (for example
    > down the worksheet).
    >
    > =IF((M2-L2)=0,""),IF((M2-L2)>0,"h:mm")
    >
    > This is what I have...I keep getting value error.
    >
    > i want the time to display if the time is greater than zero, but if less
    > than zero, display nothing.
    >
    > Thanks,
    >
    > Cyrus


  5. #5
    Tim C
    Guest

    Re: Formals with IF and Then

    Cyrus,

    Try:

    =IF(M2>L2,M2-L2,"")

    With that formula, you will get a value if you have a departure time but no
    arrival time. If that is a potential problem, use:

    =IF((M2-L2)*L2>0,M2-L2,"")


    In both cases, format the cell as time. If elapsed time may exceed 12
    hours, use the custom number format [h]:mm


    Tim C


    "Cyrus" <Cyrus@discussions.microsoft.com> wrote in message
    news:32F8E5D1-0BE5-42EB-B3AA-21DE9E6FA37F@microsoft.com...
    >I need help with a formula. I'm creating a spreadsheet where data entry
    > would indicate the time a patient arrives and than leaves. I need a
    > formula
    > that calculates this, but displays nothing if no time is entered (for
    > example
    > down the worksheet).
    >
    > =IF((M2-L2)=0,""),IF((M2-L2)>0,"h:mm")
    >
    > This is what I have...I keep getting value error.
    >
    > i want the time to display if the time is greater than zero, but if less
    > than zero, display nothing.
    >
    > Thanks,
    >
    > Cyrus




  6. #6
    Cyrus
    Guest

    RE: Formals with IF and Then

    It worked!!! Thanks so much!!!

    Cyrus

    "CLR" wrote:

    > =TEXT(IF(M2-L2>0,M2-L2,""),"h:mm")
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >
    >
    >
    > "Cyrus" wrote:
    >
    > > I need help with a formula. I'm creating a spreadsheet where data entry
    > > would indicate the time a patient arrives and than leaves. I need a formula
    > > that calculates this, but displays nothing if no time is entered (for example
    > > down the worksheet).
    > >
    > > =IF((M2-L2)=0,""),IF((M2-L2)>0,"h:mm")
    > >
    > > This is what I have...I keep getting value error.
    > >
    > > i want the time to display if the time is greater than zero, but if less
    > > than zero, display nothing.
    > >
    > > Thanks,
    > >
    > > Cyrus


+ 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