+ Reply to Thread
Results 1 to 6 of 6

can we convert "2 days 16 hrs" to " 64hrs" using excel functions

  1. #1
    chris
    Guest

    can we convert "2 days 16 hrs" to " 64hrs" using excel functions

    i tried diffeernt methods. i can either convert days to hrs or hrs to days.
    but am not able to do both. so if anybody can do it. plz let me know.

    thanks
    chris

  2. #2
    Bob Phillips
    Guest

    Re: can we convert "2 days 16 hrs" to " 64hrs" using excel functions

    If the data is how you stated, this will work

    =LEFT(A1,FIND(" ",A1)-1)*24+MID(SUBSTITUTE(A1," hrs",""),FIND(" ",A1,FIND("
    ",A1)+1)+1,99)&"hrs"

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "chris" <[email protected]> wrote in message
    news:[email protected]...
    > i tried diffeernt methods. i can either convert days to hrs or hrs to

    days.
    > but am not able to do both. so if anybody can do it. plz let me know.
    >
    > thanks
    > chris




  3. #3
    Bob Phillips
    Guest

    Re: can we convert "2 days 16 hrs" to " 64hrs" using excel functions

    slightly better

    =LEFT(A1,FIND(" ",A1)-1)*24+MID(TRIM(SUBSTITUTE(A1,"hrs","")),FIND("
    ",A1,FIND(" ",A1)+1)+1,99)&"hrs"

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "chris" <[email protected]> wrote in message
    news:[email protected]...
    > i tried diffeernt methods. i can either convert days to hrs or hrs to

    days.
    > but am not able to do both. so if anybody can do it. plz let me know.
    >
    > thanks
    > chris




  4. #4
    Biff
    Guest

    Re: can we convert "2 days 16 hrs" to " 64hrs" using excel functions

    Hi!

    Maybe something like this:

    =IF(ISNUMBER(SEARCH(" day",A1)),24*LEFT(A1,FIND("
    ",A1)-1),0)+IF(ISNUMBER(SEARCH(" hr",A1)),TRIM(RIGHT(SUBSTITUTE(A1,"
    hrs",""),2)),0)

    It'll work on the following formats:

    2 days
    99 hrs
    0 days 0 hrs
    2 days 99 hrs
    (any number of days) days ( up to any 2 digits) hrs

    Biff

    "chris" <[email protected]> wrote in message
    news:[email protected]...
    >i tried diffeernt methods. i can either convert days to hrs or hrs to days.
    > but am not able to do both. so if anybody can do it. plz let me know.
    >
    > thanks
    > chris




  5. #5
    Dave Peterson
    Guest

    Re: can we convert "2 days 16 hrs" to " 64hrs" using excel functions

    I'm not sure if this is a possibility for you, but if you used two cells -- one
    for hours and one for days, then your life may get easier.



    chris wrote:
    >
    > i tried diffeernt methods. i can either convert days to hrs or hrs to days.
    > but am not able to do both. so if anybody can do it. plz let me know.
    >
    > thanks
    > chris


    --

    Dave Peterson

  6. #6
    Fred Smith
    Guest

    Re: can we convert "2 days 16 hrs" to " 64hrs" using excel functions

    If you have an actual Excel time in your cell, the format [h] will display the
    64 hours for you. The brackets tell excel to display more than 24 hours.

    --
    Regards,
    Fred


    "chris" <[email protected]> wrote in message
    news:[email protected]...
    >i tried diffeernt methods. i can either convert days to hrs or hrs to days.
    > but am not able to do both. so if anybody can do it. plz let me know.
    >
    > thanks
    > chris




+ 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