+ Reply to Thread
Results 1 to 3 of 3

=LEFT on cell with HH:MM format

  1. #1
    Registered User
    Join Date
    06-17-2020
    Location
    London
    MS-Off Ver
    MS Office 365
    Posts
    1

    =LEFT on cell with HH:MM format

    Good morning,

    I have some data, 95% of which is in the correct format, displaying just times in each cell e.g. 09:30. However some cells also contain text, which I do not want. In the majority of cells the text appears after the time, so I thought I could just use an =LEFT formula to keep the time and remove the text after.

    The =LEFT formula gives the below results. It works on the cells containing text but then changes the cells, which are currently in the correct format (just showing times), in to numbers and I cannot change this back to the correct format using.


    Formula used is =LEFT(A2,5)


    =LEFT.JPG


    Any help or suggestions on other ways to achieve what I am trying to do would be greatly appreciated.

    Many thanks
    George

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,377

    Re: =LEFT on cell with HH:MM format

    The problem is that using TEXT just gives you a text value ... like it says on the tin.

    The examples where you have a true time are just being represented as the text of the original numeric value. So, if you just said =A2 and converted it to General Format, you would get 0.947916667. As it is, you are truncating the value to 0.945. That is, 5 text characters from the original numeric value.

    Where you have text in the cell, you get the "time" but it is just TEXT that looks like a time.

    Depending on what you want/need to do with the end results will determine the best approach to take.

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: =LEFT on cell with HH:MM format

    another variant that might work for you

    B2: =IFERROR(LEFT(TEXT($A2,"hh:mm"),5)+0,$A2)
    format as hh:mm; copied down

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Format Cell if it has been a week since Date in Left Adjacent Cell
    By MatthewTaylor in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-27-2020, 11:38 AM
  2. Formula to move data to Left when LEFT cell is blank?
    By wer5150 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2019, 05:26 AM
  3. Formula to move data to Left when LEFT cell is blank?
    By wer5150 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-31-2019, 05:22 AM
  4. Replies: 3
    Last Post: 11-30-2015, 07:49 AM
  5. Replies: 3
    Last Post: 07-01-2014, 01:51 PM
  6. LEFT formula, cell format as number?
    By netvic in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-08-2010, 07:10 PM

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