Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default Convert times to text string

In adjacent cells (A1 and A2) I have formatted start/stop times showing as
7:00 AM and 5:30 PM. In cell A3 I want concantenated text to appear as
"7:00am-5:30pm". So far this formula

=TEXT(HOUR(A1),"0")&":"&TEXT(MINUTE(A1),"00")&IF(H OUR(A1)<12,"am-","pm-")&TEXT(HOUR(B1),"0")&":"&TEXT(MINUTE(B1),"00")&IF (HOUR(B1)<12,"am","pm")

gives 7:00am-17:30pm. I want the 17:30pm to appear as 5:30pm

Please help, I haven't quite cracked this nut. And is there an easier way
than what I am doing? Using Excel 2003.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 132
Default Convert times to text string

Copy and paste the below formula in A3 cell
=TEXT(A1,"H:MM AM/PM")&" - "&TEXT(A2,"H:MM AM/PM")

Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"AZSteve" wrote:

In adjacent cells (A1 and A2) I have formatted start/stop times showing as
7:00 AM and 5:30 PM. In cell A3 I want concantenated text to appear as
"7:00am-5:30pm". So far this formula

=TEXT(HOUR(A1),"0")&":"&TEXT(MINUTE(A1),"00")&IF(H OUR(A1)<12,"am-","pm-")&TEXT(HOUR(B1),"0")&":"&TEXT(MINUTE(B1),"00")&IF (HOUR(B1)<12,"am","pm")

gives 7:00am-17:30pm. I want the 17:30pm to appear as 5:30pm

Please help, I haven't quite cracked this nut. And is there an easier way
than what I am doing? Using Excel 2003.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Convert times to text string

=LOWER(TEXT(A1,"h:mmam/pm-")&TEXT(B1,"h:mmam/pm"))


"AZSteve" wrote:

In adjacent cells (A1 and A2) I have formatted start/stop times showing as
7:00 AM and 5:30 PM. In cell A3 I want concantenated text to appear as
"7:00am-5:30pm". So far this formula

=TEXT(HOUR(A1),"0")&":"&TEXT(MINUTE(A1),"00")&IF(H OUR(A1)<12,"am-","pm-")&TEXT(HOUR(B1),"0")&":"&TEXT(MINUTE(B1),"00")&IF (HOUR(B1)<12,"am","pm")

gives 7:00am-17:30pm. I want the 17:30pm to appear as 5:30pm

Please help, I haven't quite cracked this nut. And is there an easier way
than what I am doing? Using Excel 2003.

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
Trying to calculate # of times text string is displayed data_entry Excel Worksheet Functions 0 April 5th 10 10:17 PM
count the amount of times a two letters appears in text string Sam Excel Discussion (Misc queries) 3 May 22nd 09 05:18 AM
Find the same text multiple times in a string seperated by commas clcnewtoaccess Excel Discussion (Misc queries) 1 March 31st 09 02:02 PM
cannot convert text string into value Andy Excel Worksheet Functions 16 September 5th 08 04:52 AM
count no of times a letter occurs in a text string nishad Excel Discussion (Misc queries) 4 January 10th 08 03:13 PM


All times are GMT +1. The time now is 06:11 AM.

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

About Us

"It's about Microsoft Excel"