Add 0 for hour in hh:mm:ss format

I have a column of times formatted to hh:mm:ss. However the data i
exported from a database table. When it comes in the data does no
always have a value for the hours digit. Here is an example of my dat
[ :10:48 ]  and [ 1:28:53 ] if the time was 10 minutes and 48 second
there is no place holder of 0 for the hours but if the time is 1 hou
28 minutes and 53 seconds, the place holder is 1. I need to be able t
format my fields so that a zero fills in if the time is less that 
hour. I have tried custom formating but can not seem to get Excel t
add a zero as a place holder. We are having to manually add a zero int
our data and it is very time consuming. Please Hel

--
Message posted from http://www.ExcelForum.com

0
2/28/2004 7:02:26 AM
excel 39879 articles. 2 followers. Follow

4 Replies
430 Views

Similar Articles

[PageSpeed] 27

Hi,

Use a formula like

=TIMEVALUE(IF(LEFT(A9)=":",0&A1,TEXT(A1,"hh:mm")))

Then Copy Paste Special as Values.

Posted via: http://www.ozgrid.com
Excel Templates Training Add-ins.
Free Excel Forum & Business Software
0
dave2624 (251)
2/28/2004 7:24:22 AM
One way, using a macro:

    Public Sub ConvertToTime()
        Dim rCell As Range
        Dim rTextCells As Range
        On Error Resume Next
        Set rTextCells = ActiveSheet.Cells.SpecialCells( _
                            xlCellTypeConstants, xlTextValues)
        On Error GoTo 0
        If Not rTextCells Is Nothing Then
            For Each rCell In rTextCells
                With rCell
                    If .Text Like ":##:##" Then
                        .Value = TimeValue("0" & .Text)
                        .NumberFormat = "hh:mm:ss"
                    End If
                End With
            Next rCell
        End If
    End Sub

Formatting won't work because the entries starting with ":" are 
interpreted as Text, not times (which are numeric). This macro converts 
the text to a time and formats the cell.

In article <caseyoconnor10.12bra0@excelforum-nospam.com>,
 caseyoconnor10 <<caseyoconnor10.12bra0@excelforum-nospam.com>> wrote:

> I have a column of times formatted to hh:mm:ss. However the data is
> exported from a database table. When it comes in the data does not
> always have a value for the hours digit. Here is an example of my data
> [ :10:48 ]  and [ 1:28:53 ] if the time was 10 minutes and 48 seconds
> there is no place holder of 0 for the hours but if the time is 1 hour
> 28 minutes and 53 seconds, the place holder is 1. I need to be able to
> format my fields so that a zero fills in if the time is less that 1
> hour. I have tried custom formating but can not seem to get Excel to
> add a zero as a place holder. We are having to manually add a zero into
> our data and it is very time consuming. Please Help
0
jemcgimpsey (6723)
2/28/2004 7:30:43 AM
I want to thank everyone....you were a huge help....I took everyone
ideas and customized a script that worked...I would not have been abl
to do this without your hel

--
Message posted from http://www.ExcelForum.com

0
3/2/2004 6:49:24 AM
Big thanks especially to JE McGimpse

--
Message posted from http://www.ExcelForum.com

0
3/2/2004 6:50:30 AM
Reply:

Similar Artilces:

Date Formatting when Concantenating
I have a simple question. I have a cell that has date that looks lik this: 10/15/1999 14:34 When I use the concantenate feature my date looks like this: 36448.6073611111 I tried to format the call every which way - but I cannot get it t look the original. Feeling really silly for even asking.. thanks all for your help -- Message posted from http://www.ExcelForum.com Hi bleu808! Use: ="Today is "&TEXT(TODAY(),"mm/dd/yyyy hh:mm") -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au "bleu808 >" <<bleu808.189yij...

Help with conditional formatting with 2000
Any help would be greatly appreciated. I am trying to group data together into increments of 10% of th numbers and then chart them based on these groups. For example, I hav 300 data points that vary from 20 to 500 in value. I want them t appear in a chart based on the number of values that fall in the lowes 10% of numbers (ie. 20-40) then the next 10% (ie. 40-60) etc. up to th top 10% of numbers, but I do not want to manually determine what thes ranges are. I want to see a distribution of how many numbers fal within each 10% of values. I am not sure if this makes sense, please let me know...

1 Chart
I presently have an XY line chart showing asset price over time. Pretty simple. X Axis - Time Scale Y Axis - Asset Price I would now like to add an additoinal series showing the volume of assets traded, ideally this would be as a bar chart sitting "underneath" the asset price on the chart. They would share the same X Axis. I have added another series, but this simply displays the volume traded as another line, and even when this is set to a secondary axis the scaling makes this unworkable. i have adjusted the scales of both, still this does not make it workable, i want the series...

CRM 4.0 External Connector
Can anyone point me to CRM 4.0 External Connector installation guide? Cheers, Mandy. "Mandy" <Mandy@discussions.microsoft.com> wrote in message news:BF297AE0-9446-46CB-91FA-CFF19A65F1DF@microsoft.com... > Can anyone point me to CRM 4.0 External Connector installation guide? The external connector is a license so nothing you need to install. -- Robert MacLean http://www.sadev.co.za thanks for update. would you know if there's any specs on how it integrates with crm? "Robert MacLean" wrote: > "Mandy" <Mandy@discussions.microsoft.com&g...

Report Format
Env: CRM 3, VS 2003, remote connect to CRM server. I've created a QUOTE in VS2003 and when viewed using PREVIEW from within the VS environment it produces a beautiful QUOTE (at least in my opinion). When printed, again from the VS environment, it is perfect. When I upload the RDL file to the CRM server, create an new REPORT using this RDL then produce a REPORT, the formatting is all over the place. When I inspect the source (in VS) there are no fields that extend past the defined size. It appers that the CRM report engine randomly adds CRLFs all thru the report ... ??? ...

How can I clear the last Data->Text to columns to formatting
I've noticed in Excel 2000 that if I paste text into various worksheets within a workbook each paste will assume the Text->Column formatting that I applied in the previous. How can I prevent it from happening ? Thanks Steve Just run another data|Text to columns against a dummy cell. Specify delimited, but remove all the check marks from all the possible delimiters. (alternatively, you can close excel and reopen it.) svaardt wrote: > > I've noticed in Excel 2000 that if I paste text into various worksheets > within a workbook each paste will assume the Text->Col...

Integrating Great Plains 8.0 and CRM 1.2 and Windows Small Busines
Integrating Great Plains 8.0 and CRM 1.2 I run a Windows Small Business Server 2003 Premium box along with a Windows Server 2003 Standard box used for my Great Plains 8.0 and SQL 2000. I’m considering introducing CRM 1.2 Professional into the mix. From a hardware stand point I know I’m fine all around. I’ve been researching how I should configure CRM and am a bit confused. The info I’ve found in KB887153 states “When you install Microsoft Business Solutions CRM Integrations for Great Plains 7.0, 7.5, or 8.0, Microsoft BizTalk Server is also installed. However, BizTalk Server 2000 and B...

How do I add a signature
We have our purchase orders created in excel and we would like to add a "handwritten" signature" to them. How to I do this? Pen If using xl2002 or 2003...... Create a graphic with the signature then add it to the Footer when printing. Gord Dibben Excel MVP On Mon, 14 Feb 2005 09:03:08 -0800, "Penfold" <Penfold@discussions.microsoft.com> wrote: >We have our purchase orders created in excel and we would like to add a >"handwritten" signature" to them. How to I do this? ...

Solver add-in and macros
I just got a new computer with XP and Excel 2003 and tried to run a macro that used to SOLVER add-in function and got a compile error. As a test I recorded a macro using the SOLVER and got the same result when I tried to run that macro. The Compile Error is "Sub or Function not defined". On the Knowledge Base it says I need to add SOLVER to the list of References in the VB Editor. When I go to the references list, SOLVER does not appear. When I open Help for VB and search for SOLVER, it finds nothing. What is going on? Why doesn't VB even recognize the existence ...

How to add new entity?
Hi. I'm now researching the customization abilities of MS CRM 1.2. So I have a small task, which I'm not able to accomplish with SDK. The main question is how to add additional entity to CRM? I need to add entity "Pets", and dictionary "PetTypes". Pets should be linked with Contacts (1:M). Pets should have 3 attributes: - Name (string of 150 chars), - Type (value from PetTypes dictionary), - Description (string of 1000 chars) PetTypes should have 3 entries: "Cat", "Dog" and "Parrot" I expect that i...

Conferting File format
One of my users stored 250 photos on CD in a pdf format. The person that will work with them wants them in a raw format. Is there any way to convert the entire disk at one time to a raw format, rather than opening each file and saving in the new format? Thank you. vsp deborah <vspdeborah@discussions.microsoft.com> was very recently heard to utter: > One of my users stored 250 photos on CD in a pdf format. The person > that will work with them wants them in a raw format. Is there any way > to convert the entire disk at one time to a raw format, rather than > opening each f...

How to get only the year in the date format in Access
How to get only the year in the date format I.e in the table in need to display only year E.g 2005 - should be display " 05" automatically Custom format the cell as: yy -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "yanu" <yanu@discussions.microsoft.com> wrote in message news:14CE9F60-F7B9-467A-8C16-71088C31BEBA@microsoft.com... > How to get only the year in the date form...

How do add another code to a current one?
I have this following code to make the rows changed based on the critea in column 16, and I need add A "Red, Yellow, Green" for status to only one column 30 at the end of the spreadsheet. How do I add another code? I keep getting an error.. Private Sub Worksheet_Change(ByVal Target As Range) Dim c As Range, clr As Long For Each c In Target.Cells If c.Column = 16 Then Select Case c.Value Case "Analyze": clr = RGB(204, 255, 255) Case "Build ": clr = RGB(204, 255, 255) Case ...

date/time formatting
I download a csv report from a web based program. Everything works great but the date comes through as "Jul 21 2009 1:51pm". I do not need the time in my report. I have tried reformatting the cells, tried to copy to a new file with the cells already formatted to "7/21/09", opening the cell format using the F2 key and deleting the time (time will still not be formatted correctly). The only way I get get just the time is to retype every cell. What am I doing wrong? I am using Excel 2002 SP3 TIA, Cindy When data is downloaded from the web, a lot of "other&quo...

Purchase Order 2.0.0127
Am I the only one having issues with the upgrade? 1) I create a purchase order 2) I click on add item 3) I type in the supplier ILC, and nothing comes up (ONLY on some items)! 4) I click on all items, and find the item, and add it! 5) When I click on OK the item is added to the purchase order, along with the supplier ILC! OR When I click on all items, even though the item may be in the database, I can't find it to add to the PO, unless I close out the PO and re-open it??? This started happening only since I upgraded the the 2.0.0127! -- Thank You Vince :) -- Thank You Vince :) Yes...

format cell #4
In Access, I can set up a field that "forces" the user to enter info - a date, for example - in a certain way, such as 25 Jan 05 or enter time as 12:15 AM. Is there a way that I can "force" this in excel? Thank you. Hello- Without invoking something more technical, you can select the cell(s) and go to Data>Validation and choose what type of entry be allowed in the field. Format the cell in the manner you wish to have the date or time expressed. HTH |:>) "HJC" wrote: > In Access, I can set up a field that "forces" the user to enter in...

Add a blank page separator
How do I add a blank page automatically as a separator after every 15 pages when printing a document of 250 pages? Use a macro containing the following code to print the document: Dim i As Long Dim blank As Document For i = 1 To 240 Step 15 ActiveDocument.PrintOut Range:=wdPrintFromTo, From:=i, To:=i + 15 Set blank = Documents.Add With blank .PrintOut .Close wdDoNotSaveChanges End With Next i -- Hope this helps, Doug Robbins - Word MVP Please reply only to the newsgroups unless you wish to obtain my services on a paid professio...

how can I add a signature to my calendar appt requests?
See subject question Insert-> Signature -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "tnowak" <tnowak@discussions.microsoft.com> wrote in message news:51100433-5C23-435B-9C1B-5F8B8D9056B2@microsoft.com... > See subject question ...

RMS 2.0 matrix dimensions are annoying, but help is available
For reasons I don't understand, MS saw fit in RMS 2.0 to use dimensions data for matrix components that is far less accessible to users than Sub Descriptions are. For instance, I can't edit assign a dimension value to an existing item I have added to a matrix. I can't see a reason for using Dimensions with limitations like this as using Sub Descs. to describe matrix "dimensions" worked fine previously. Does anyone know why MS did this? It's annoying! Digital Retail Solutions (DRS) has a product called Power Ops (Build 2.2.0003). It's help file mentions (se...

unicode format files for Outlook 2002
I use Outlook 2002. I would like to use Unicode files (for larger size). I see references to using it with Outlook 2003, but none for 2002. can unicode files be used with Outlook 2002? If so, how? thanks, Huck No OL 2003 & 2007 only "Huck Rorick" <huckrorick@groundwork.org> wrote in message news:epYUYAl4IHA.2348@TK2MSFTNGP06.phx.gbl... >I use Outlook 2002. I would like to use Unicode files (for larger size). >I see references to using it with Outlook 2003, but none for 2002. can >unicode files be used with Outlook 2002? If so, how? > > than...

time formats #3
I have an Excel sheet with a long list of times spent on various projects. The times should all be in minutes and seconds. The first time reads 2:29 and I know that is accurate, for 2 min, 29 seconds. In the formula bar, it reads, 2:29:00 AM. Another...the cell displays 0:40 and I know that is right, for 40 seconds. But in the formula bar, I see 12:40:00 AM I want numbers, but apparently I am looking at times. I tried changing the format. When I check the format for 2:29, it comes up Custom and says it is hh:mm, not mm:ss. I tried changing it to mm:ss, but that changes the displa...

Upgrade GP 9.0 SP2 to GP 10.0 Advice
Hi, We are planning our upgrade of GP9.0 SP2 to GP10.0. We are running SQL 2000 and would like to also upgrade to SQL 2005. I am using the following url (and read some threads on this forum): https://mbs.microsoft.com/customersource/support/knowledgebase/hottopics/hot_topic_updatingmicrosoftdynamicsgp10.htm?printpage=false (page: Updating to Microsoft Dynamics GP 10.0) The chart Microsoft provides says I can go from 9.00.0281 (which is SP2) to 10.0 or any patch install. What does "any patch install" mean? Does this mean I can't go directly to 10.0 Feature Pack 1? Would i...

Formatting cells and getting pound signs
I am using Excel 2003 with all updates as of 4/28/04 and trying to format a cell using the custom category and choosing the #,##0.00 type. I am trying to add the $ symbol at the beginning of the type and add text at the end of the type to look like this $#,##0.00 "text". When I do this however it shows up in my cell on my worksheet as ##########. It does know what the value is and shows as I would expect it to when I place mouse over cell in a balloon If I use only the $ symbol befor the type it shows fine. If I use only the "text" after the type is shows fine. Using the...

CRM 3.0
Folks Any way that we can assign leads / opportunities / other entities to teams rather than individuals? All the best Hany Hi Hany, Team ownership is not supported in CRM 3.0. Could you describe your scenario, and maybe we could provide some alternatives? Thanks -- Jay Grewal Microsoft Dynamics CRM This posting is provided "AS IS" with no warranties and confers no rights. "Electronic Workplace" <info@electronicworkplace.LoseThisBit.com> wrote in message news:O0cfzAT$FHA.140@TK2MSFTNGP12.phx.gbl... > Folks > > Any way that we can assign leads /...

Too many different cell formats #6
I am running into the error message: Too many different cell formats Is there a solution to lowering the number of formats I am using? Just trying to change them to make some consistent gives me the same error message. I tried running the search on the forums on my topic but they have been disabled for a Microsoft upgrade. Thanks! One idea - Rob Bovey's excellent Utilities add-in will list all the formats in use in your workbook, allowing you to manually delete what isn't being used. http://www.appspro.com/Utilities/ExcelUtilities.htm You can also see the source code for ...