Solved

How to Convert Number to Time value - Excel 2007

Posted on 2011-09-27
8
264 Views
Last Modified: 2012-05-12
Hello experts,

I have a table in excel containing time but written as number (not time values)

For example 600 instead of 06:00

I need your help in developing a user function that would convert 600 to 06:00.

Please see attched sample sheet.

Thank you     Convert-number-to-Time.xlsx
0
Comment
Question by:Mehawitchi
8 Comments
 
LVL 12

Expert Comment

by:viralypatel
ID: 36709950
1. select the entire column
2. right click and select format cells
3. select time.
0
 
LVL 18

Expert Comment

by:x-men
ID: 36709983
A1:600

B1:
=IF(LEN(A1)=3;"0"&LEFT(A1;1)&":"&RIGHT(A1;2);LEFT(A1)&":"&RIGHT(A1;2))
0
 

Author Comment

by:Mehawitchi
ID: 36709986
Hi viralypatel
Thanks for the suggested solution, but I've tried this already and didn't work. It gave me wrong dates and time.

Have you tried it yourself? Did it work?
0
 
LVL 24

Accepted Solution

by:
StephenJR earned 250 total points
ID: 36709998
I don't normally go near date/time questions, but this seems to work for your sample:

=TIME(C2/100,RIGHT(C2,2),0)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 24

Expert Comment

by:StephenJR
ID: 36710001
Took me so long I didn't see all those posts!
0
 
LVL 2

Assisted Solution

by:sanofi-aventis
sanofi-aventis earned 150 total points
ID: 36710016
Mehawitchi,

This is a cell formula. If you need a VBA formula it should be easy to convert.

=TIME(MID(C2,1,CHOOSE(LEN(C2),1,1,1,2)),MID(C2,CHOOSE(LEN(C2),3,3,2,3), 2),0)

Sincerely,
T-Bone
0
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 100 total points
ID: 36710027
You can use this formula in another column, see attached

=TEXT(C2,"00\:00")+0

format as hh:mm

regards, barry
27343557.xlsx
0
 

Author Comment

by:Mehawitchi
ID: 36710125
Hey, I'm overwhelmed.

All solutions worked but my preference goes to StephenJR because in one step I have a time value
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Match formula returns N/A 5 25
Excel 2016 - Black cell borders 11 27
Excel:  Find text between 2nd hyphen and next space 10 30
File not loading into PowerPivot 4 9
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now