Cell format

TIM WEIPERS

New Member
Joined
Sep 23, 2004
Messages
37
Hi,

I need the cells in a workbook formatted for date time in order to be able to calculate time differences over midnight. However, I don't want the cell to actually show the date only the time. Is this possible ?

Many thanks
Tim
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456
Hello TIM WEIPERS,
Unless there's more to your question than I'm seeing, all you need to do is format
your range(s) to display the way you want.
If you enter '8/13/07 9:15:25 PM' into a cell and then format it as Time > 1:30 PM,
the cell's value will be the date/time but the display will be '9:15 PM'

Is that what you're looking for?
 
Upvote 0

TIM WEIPERS

New Member
Joined
Sep 23, 2004
Messages
37
Hi Andrew / Halface,

I thought that might be the case. What I really want is for other users to be able to enter a time in cell B13 and another time in cell C14 (ie without them having to enter a date at all) and the difference to be shown in cell D13 even if the time in cell C14 has gone over midnight.

I don't think it'll be possible but who knows.
Thanks
Tim
 
Upvote 0

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
If A1 contains the start time and A2 the end time:

Code:
=A2-A1+(A2<A1)

will cater for going over midnight.
 
Upvote 0

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,358
Office Version
  1. 365
Platform
  1. Windows
Code:
If A1 contains the start time and A2 the end time:

=A2-A1+(A2<A1)

will cater for going over midnight.
 
Upvote 0

TIM WEIPERS

New Member
Joined
Sep 23, 2004
Messages
37
Chaps,

Many thanks. With a bit of tinkering, it works (not tinkering with your formula; tinkering with the rest of mine !).

Cheers
Tim
 
Upvote 0

Forum statistics

Threads
1,191,587
Messages
5,987,512
Members
440,098
Latest member
MickyMouse123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top