+ Reply to Thread
Results 1 to 7 of 7

Extract hours from data value

  1. #1
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Extract hours from data value

    Hi, i have a cell with data format with the following: 01-01-12 09:30.

    In another cell i want to extract from the previews value only the time (hours and minutes).


    How can do it?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Extract hours from data value

    Use the MOD() function to get the decimal value from that number, then format it as TIME.

    =MOD(A1, 1)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Extract hours from data value

    ----------------------------------------
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Re: Extract hours from data value

    Hi,

    Thanks for the reply.

    My excel is in my natural language and not in english, so i attached the file so you can insert the function, please.

    Thank you for the help!
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Re: Extract hours from data value

    Can anyone give me a tip?
    thanks

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Extract hours from data value

    Hi

    See the example.
    Attached Files Attached Files

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Extract hours from data value

    1) In C3 enter the formula given earlier: =MOD(B3, 1)
    2) Now select C3 and press Ctrl-F1, select the TIME number format of your choosing.

+ 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