+ Reply to Thread
Results 1 to 8 of 8

Single digit minutes displayed with a leading zero

Hybrid View

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    Southport, England
    MS-Off Ver
    Excel 2011(for mac)
    Posts
    28

    Single digit minutes displayed with a leading zero

    I have imported from a csv file into excel a time in the format mm:ss.0. As long as both minutes and seconds are 2 digits the time is displayed as I want them to be e.g. 11:22.1.
    But when the minutes are single digits such as 3:22.1 the display is 03:22.1. How can I stop excel putting in the leading zero?

    I look forward to your suggestions

    Thank you

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,440

    Re: Single digit minutes displayed with a leading zero

    Apply a Custom Format to those cells of:

    m:ss.0

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    09-04-2013
    Location
    Southport, England
    MS-Off Ver
    Excel 2011(for mac)
    Posts
    28

    Re: Single digit minutes displayed with a leading zero

    Pete,

    Thanks for that I thought I would need mm to allow the time to go into double digits but tried with single and double and all ok.

    Many thanks I close this now

    Dave

  4. #4
    Registered User
    Join Date
    09-04-2013
    Location
    Southport, England
    MS-Off Ver
    Excel 2011(for mac)
    Posts
    28

    Re: Single digit minutes displayed with a leading zero

    I have applied the custom format to the cells involved but this is after the import so I know which cells need formatting. If I import another set of data I will not know which cells will be used so how can I do the formatting in the right place?
    I used File...Import function, by using vba to import could the formatting be done as the data is imported? This is just one of a whole number of issues I am trying to tackle so not sure if to try and sort individually or try to tackle everything but I feel there is so much and complicated it would be quite difficult to explain.

    Thanks

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,440

    Re: Single digit minutes displayed with a leading zero

    Do you mean that the next time you import the data the times might be in a different column, or that there may be more or fewer rows of them in the same column? If the times are in the same column then you could apply the custom formatting to the whole column, so it doesn't matter how much data you have. If the times might be in a different column then you would need some way of determining which column - do you have a header that could be used?

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    09-04-2013
    Location
    Southport, England
    MS-Off Ver
    Excel 2011(for mac)
    Posts
    28

    Re: Single digit minutes displayed with a leading zero

    Thanks for that. I have now put together all my needs into a file explaining what I'm trying to do but not sure if I should send this just to you or raise a new post in the vba forum. Any advice appreciated.

    Dave

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Single digit minutes displayed with a leading zero

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window (or use the paperclip icon).
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Registered User
    Join Date
    09-04-2013
    Location
    Southport, England
    MS-Off Ver
    Excel 2011(for mac)
    Posts
    28

    Re: Single digit minutes displayed with a leading zero

    Thank you for responding to this. As there is so much more involved I have opened a new post in the vba forum, this is the link to it http://www.excelforum.com/showthread.php?t=1137276

    Dave

+ 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] Color a single digit in a mult-digit number cell
    By Phyllis in forum Excel General
    Replies: 8
    Last Post: 09-30-2022, 04:22 PM
  2. [SOLVED] How to subtract single cells with double digits into a single digit of a single cell.
    By greenfox74 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-11-2021, 02:05 AM
  3. [SOLVED] Adding leading Zero to single digit HELP
    By jambog in forum Excel General
    Replies: 5
    Last Post: 03-11-2016, 01:40 PM
  4. [SOLVED] convert a time in minutes to a single digit
    By bzl in forum Excel General
    Replies: 5
    Last Post: 11-18-2015, 06:30 AM
  5. [SOLVED] Changing 5-digit Zip to 3-digit zip without losing leading zeros
    By Jennifer C in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2014, 09:26 AM
  6. [SOLVED] LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash
    By david gonzalez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2014, 12:57 AM
  7. Replies: 7
    Last Post: 11-03-2011, 05:29 AM

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