#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Time function

Hi everybody,
I have a question relating Time function. I have put time in cell A1 and
formula
"=TIME(HOUR(A1)+12,MINUTE(A1),SECOND(A1))" in cell B1 the problem is when
the hour exceeds 12 O'clock midnight it gives the error #NUM! instead of
showing the exact time suppose cell A1 has the value 4.00 PM then the formula
shows the error msg instead of showing 4.00 AM of next day
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Time function

When I tested your formula in B1,
with A1 containing: 4:00 PM
(not "4.00 PM" as posted - the colon is important)
B1 returned: 4:00 AM
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Arup C" wrote:
Hi everybody,
I have a question relating Time function. I have put time in cell A1 and
formula
"=TIME(HOUR(A1)+12,MINUTE(A1),SECOND(A1))" in cell B1 the problem is when
the hour exceeds 12 O'clock midnight it gives the error #NUM! instead of
showing the exact time suppose cell A1 has the value 4.00 PM then the formula
shows the error msg instead of showing 4.00 AM of next day

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Time function

Hi Max,
Thanks for replying. It was my mistake. It was now solved but when I am
deducting 12 hours from the given time it is showing the same error.

"Max" wrote:

When I tested your formula in B1,
with A1 containing: 4:00 PM
(not "4.00 PM" as posted - the colon is important)
B1 returned: 4:00 AM
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Arup C" wrote:
Hi everybody,
I have a question relating Time function. I have put time in cell A1 and
formula
"=TIME(HOUR(A1)+12,MINUTE(A1),SECOND(A1))" in cell B1 the problem is when
the hour exceeds 12 O'clock midnight it gives the error #NUM! instead of
showing the exact time suppose cell A1 has the value 4.00 PM then the formula
shows the error msg instead of showing 4.00 AM of next day

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Time function

TIME won't accept a negative number for hours. You were right the first
time in that you ought to *add* 12 hours, not subtract 12 hours.
--
David Biddulph

"Arup C" wrote in message
...
Hi Max,
Thanks for replying. It was my mistake. It was now solved but when I am
deducting 12 hours from the given time it is showing the same error.

"Max" wrote:

When I tested your formula in B1,
with A1 containing: 4:00 PM
(not "4.00 PM" as posted - the colon is important)
B1 returned: 4:00 AM
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Arup C" wrote:
Hi everybody,
I have a question relating Time function. I have put time in cell A1
and
formula
"=TIME(HOUR(A1)+12,MINUTE(A1),SECOND(A1))" in cell B1 the problem is
when
the hour exceeds 12 O'clock midnight it gives the error #NUM! instead
of
showing the exact time suppose cell A1 has the value 4.00 PM then the
formula
shows the error msg instead of showing 4.00 AM of next day



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 32
Default Time function

Hi David,
I think ur right but is there any way out using other function with time
function

"David Biddulph" wrote:

TIME won't accept a negative number for hours. You were right the first
time in that you ought to *add* 12 hours, not subtract 12 hours.
--
David Biddulph

"Arup C" wrote in message
...
Hi Max,
Thanks for replying. It was my mistake. It was now solved but when I am
deducting 12 hours from the given time it is showing the same error.

"Max" wrote:

When I tested your formula in B1,
with A1 containing: 4:00 PM
(not "4.00 PM" as posted - the colon is important)
B1 returned: 4:00 AM
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Arup C" wrote:
Hi everybody,
I have a question relating Time function. I have put time in cell A1
and
formula
"=TIME(HOUR(A1)+12,MINUTE(A1),SECOND(A1))" in cell B1 the problem is
when
the hour exceeds 12 O'clock midnight it gives the error #NUM! instead
of
showing the exact time suppose cell A1 has the value 4.00 PM then the
formula
shows the error msg instead of showing 4.00 AM of next day






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Time function

Sorry, I don't understand what you are asking.

If you want another way of getting a time equivalent to12 hours before or
after A1, instead of the formula you've got already
[=TIME(HOUR(A1)+12,MINUTE(A1),SECOND(A1)) ],
then you could use =MOD(A1+0.5,1) or =MOD(A1-0.5,1) [both of which would
give the same result], and format the result as time.
Another couple of ways of getting the same result would be
=MOD(A1+TIME(12,0,0),1) or =MOD(A1-TIME(12,0,0),1)

The reason that all these give the same answer is that Excel stores dates
and times as units of one day, so 12 hours is equivalent to 0.5

The MOD(...,1) strips off the date part (the integer component) and leaves
you with the time.
--
David Biddulph

"Arup C" wrote in message
...
Hi David,
I think ur right but is there any way out using other function with time
function

"David Biddulph" wrote:

TIME won't accept a negative number for hours. You were right the first
time in that you ought to *add* 12 hours, not subtract 12 hours.
--
David Biddulph

"Arup C" wrote in message
...
Hi Max,
Thanks for replying. It was my mistake. It was now solved but when I am
deducting 12 hours from the given time it is showing the same error.

"Max" wrote:

When I tested your formula in B1,
with A1 containing: 4:00 PM
(not "4.00 PM" as posted - the colon is important)
B1 returned: 4:00 AM
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Arup C" wrote:
Hi everybody,
I have a question relating Time function. I have put time in cell A1
and
formula
"=TIME(HOUR(A1)+12,MINUTE(A1),SECOND(A1))" in cell B1 the problem is
when
the hour exceeds 12 O'clock midnight it gives the error #NUM!
instead
of
showing the exact time suppose cell A1 has the value 4.00 PM then
the
formula
shows the error msg instead of showing 4.00 AM of next day






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
time function Winkle Bill Excel Worksheet Functions 1 August 30th 07 09:10 AM
verify use of TIME Function, Find Quantity Level compare to time-d nastech Excel Discussion (Misc queries) 9 July 11th 07 01:58 PM
One-time NOW() function BigD Excel Worksheet Functions 3 September 28th 06 06:24 PM
TIME function Jlexky Excel Worksheet Functions 2 December 31st 05 03:35 PM
Function to convert Time String to Time Andibevan Excel Worksheet Functions 6 August 19th 05 01:19 PM


All times are GMT +1. The time now is 09:05 PM.

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"