#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default formula help

I need some help, I am using Excel 2003 and need help with a formula. Cell
"B4" has a time entered into it, lets say 7:00 AM; Cell "B5" has a time
entered also, lets say "15:30 PM. In cell "F6" I would to combine these two
times in the cell to look like "7:00-3:30". Hope this is possible and if it
is how would I do it.
If any more information is needed let me know.
Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default formula help

Try the following formula (all on one line)

=LEFT(TEXT(B4,"h:mm
am/pm"),4+(OR(AND(HOUR(B4)=10,HOUR(B4)<=12),AND(HOUR (B4)=22,HOUR(B4)<=23))))&"-"&LEFT(TEXT(F6,"h:mm
am/pm"),4+(OR(AND(HOUR(F6)=10,HOUR(F6)<=12),AND(HOUR (F6)=22,HOUR(F6)<=23))))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"chefmike" wrote in message
...
I need some help, I am using Excel 2003 and need help with a formula. Cell
"B4" has a time entered into it, lets say 7:00 AM; Cell "B5" has a time
entered also, lets say "15:30 PM. In cell "F6" I would to combine these
two
times in the cell to look like "7:00-3:30". Hope this is possible and if
it
is how would I do it.
If any more information is needed let me know.
Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default formula help

Thanks Chip
That worked like a charm.
Thanks again

"Chip Pearson" wrote:

Try the following formula (all on one line)

=LEFT(TEXT(B4,"h:mm
am/pm"),4+(OR(AND(HOUR(B4)=10,HOUR(B4)<=12),AND(HOUR (B4)=22,HOUR(B4)<=23))))&"-"&LEFT(TEXT(F6,"h:mm
am/pm"),4+(OR(AND(HOUR(F6)=10,HOUR(F6)<=12),AND(HOUR (F6)=22,HOUR(F6)<=23))))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"chefmike" wrote in message
...
I need some help, I am using Excel 2003 and need help with a formula. Cell
"B4" has a time entered into it, lets say 7:00 AM; Cell "B5" has a time
entered also, lets say "15:30 PM. In cell "F6" I would to combine these
two
times in the cell to look like "7:00-3:30". Hope this is possible and if
it
is how would I do it.
If any more information is needed let me know.
Thanks in advance




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default formula help

Hi Mike,

Let's suppose all your second times are in the afternoon, a shorter formula
would be:

=TEXT(B5,"h:mm")&"-"&TEXT(C5-0.5,"h:mm")

If they are not then

=TEXT(B5,"H:MM")&"-"&TEXT(IF(C50.5,C5-0.5,C5),"h:mm")


--
Cheers,
Shane Devenshire


"chefmike" wrote:

Thanks Chip
That worked like a charm.
Thanks again

"Chip Pearson" wrote:

Try the following formula (all on one line)

=LEFT(TEXT(B4,"h:mm
am/pm"),4+(OR(AND(HOUR(B4)=10,HOUR(B4)<=12),AND(HOUR (B4)=22,HOUR(B4)<=23))))&"-"&LEFT(TEXT(F6,"h:mm
am/pm"),4+(OR(AND(HOUR(F6)=10,HOUR(F6)<=12),AND(HOUR (F6)=22,HOUR(F6)<=23))))


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"chefmike" wrote in message
...
I need some help, I am using Excel 2003 and need help with a formula. Cell
"B4" has a time entered into it, lets say 7:00 AM; Cell "B5" has a time
entered also, lets say "15:30 PM. In cell "F6" I would to combine these
two
times in the cell to look like "7:00-3:30". Hope this is possible and if
it
is how would I do it.
If any more information is needed let me know.
Thanks in advance




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
Reusing formula Tony29 Excel Discussion (Misc queries) 7 September 7th 06 03:34 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM


All times are GMT +1. The time now is 08:41 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"