Format data to a different look

  • Thread starter Thread starter rylv5050
  • Start date Start date
R

rylv5050

I receive a spreadsheet with data that I need to copy and paste this in to
another spreadsheet.

The data appears as follows in the following format:
1378:20:00
675:00:00
11:40:00
1:40:00
0:00

I need to write a formula or convert this into the following format:
1378.20
675.00
11.40
1.40
0.00

How can this be accomplished?
 
With a formula, you can use

=INT(A1*24)+(MINUTE(A1)/100)

To convert a lot of cells at once, use the following code:

Sub AAA()
Dim R As Range
For Each R In Selection.Cells
R.Value = Int(R * 24) + (Minute(R) / 100)
Next R
End Sub

Select the cell(s) you want to convert and then run the code. Be sure
to format the result cells as General or Numeric, not Date or Time.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
I would think you can use this formula in another cell...

=TEXT(A1,"[h].mm")

and Copy/Paste Special/Values that column into your other worksheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top