+ Reply to Thread
Results 1 to 5 of 5

Using RIGHT Function to extract time values in date / time field

  1. #1
    Registered User
    Join Date
    03-19-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    10

    Question Using RIGHT Function to extract time values in date / time field

    Hello everyone:

    I am trying to use the RIGHT function to extract the time from a date / time field. I've also attached the sample Excel file.

    Example from Cell B3:
    3/8/10 11:55 AM

    I tried the RIGHT function in this manner (Cell C6):
    =RIGHT(B1,8)

    But, it gave me this answer even though I formatted it as "Time" (Cell C6)
    68829282

    It seems to me that the RIGHT function can only be used on alphanumeric characters. Is there another function or way to extract the 11:55 AM from the cell?

    Thanks in advance for your help.
    Attached Files Attached Files
    Last edited by endora75; 03-23-2010 at 12:45 PM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Using RIGHT Function to extract time values in date / time field

    How about right click > format >number > time "hh:mm AM/PM" on the cell containing the date, or

    =TEXT(A1,"hh:mm am/pm")
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Using RIGHT Function to extract time values in date / time field

    Hi,

    You are dealing with a format issue ...

    In cell C6, you can have =B3 and format this cell as Time ...

    HTH

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Using RIGHT Function to extract time values in date / time field

    Or if you want to keep it as a number, lets say your date/time is in A1

    =A1-INT(A1) and format the cell as time.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    03-19-2010
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Using RIGHT Function to extract time values in date / time field

    Thanks to everyone who has responded so far. I have another question that I'll post as a follow-up.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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