Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Replace numbers with time

I downloaded "sunrise/sunset" data into an Excel 2003 spreadhseet but the
times came as numbers, like "1622". I want to convert that to "16:22" but
the format cell option does not work. It converts it to a date and a time
(noon). Since the times change every few cells, search and replace is
inefficient. I tried searching for 16** and replacing them with 16:** but
Excel took that liberally. Is there a wildcard command to replace these
numbers: 1622, 1623, 1624 with 16:22, 16:23, 16:24?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default Replace numbers with time

=TIME(INT(A1/100),MOD(A1,100),0)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"nantucketbob" wrote in message
...
I downloaded "sunrise/sunset" data into an Excel 2003 spreadhseet but the
times came as numbers, like "1622". I want to convert that to "16:22" but
the format cell option does not work. It converts it to a date and a time
(noon). Since the times change every few cells, search and replace is
inefficient. I tried searching for 16** and replacing them with 16:** but
Excel took that liberally. Is there a wildcard command to replace these
numbers: 1622, 1623, 1624 with 16:22, 16:23, 16:24?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Replace numbers with time

One way is to transform those numbers to Excel time values with this formula
in another cell (1622 being in A1):

=TIMEVALUE(LEFT(A1,2)&":"&RIGHT(A1,2))

Format the result cells like time!

If necessary, you can overwrite the original numbers with the time values
via Copy/PasteSpecial-Values.


--
Regards!
Stefi



€žnantucketbob€ť ezt Ă*rta:

I downloaded "sunrise/sunset" data into an Excel 2003 spreadhseet but the
times came as numbers, like "1622". I want to convert that to "16:22" but
the format cell option does not work. It converts it to a date and a time
(noon). Since the times change every few cells, search and replace is
inefficient. I tried searching for 16** and replacing them with 16:** but
Excel took that liberally. Is there a wildcard command to replace these
numbers: 1622, 1623, 1624 with 16:22, 16:23, 16:24?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Replace numbers with time

One more...

if 16:22 means 16 hours, 22 minutes, 0 seconds:
=--text(a1,"00\:00")

if 16:22 means 0 hours, 16 minutes, 22 seconds:
=--text(a1,"00\:00\:00")

And format the cell as a time.

The first minus coerces the text value into a number, but it's a negative
number. The second minus changes the sign back to positive/non-negative.



nantucketbob wrote:

I downloaded "sunrise/sunset" data into an Excel 2003 spreadhseet but the
times came as numbers, like "1622". I want to convert that to "16:22" but
the format cell option does not work. It converts it to a date and a time
(noon). Since the times change every few cells, search and replace is
inefficient. I tried searching for 16** and replacing them with 16:** but
Excel took that liberally. Is there a wildcard command to replace these
numbers: 1622, 1623, 1624 with 16:22, 16:23, 16:24?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
replace letters for numbers Maria Teresa Excel Discussion (Misc queries) 5 June 4th 09 03:26 PM
replace numbers with X davids Excel Discussion (Misc queries) 5 March 16th 06 01:48 AM
How do I replace numbers in a value NOT a formula? Riverrat Excel Discussion (Misc queries) 8 February 26th 06 01:15 PM
greater than replace numbers mja Excel Worksheet Functions 1 March 23rd 05 06:41 PM
How to Replace numbers and text with numbers only? Robert Judge Excel Worksheet Functions 3 November 5th 04 04:36 PM


All times are GMT +1. The time now is 03:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"