#1   Report Post  
Bob Hoath
 
Posts: n/a
Default Time in formulae

I have a time value in a cell (A1) formatted hh:mm. Say the value is 20:00.
In cell B1 I am trying to write a formula IF(A117:00,A1-17:00,0). This
should give me an answer 3:00 but I get error reports. I have tried
enclosing in brackets but to no avail. Any suggestions please?


  #2   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

=IF(A117/24,A1-17/24,0)


--
Arvi Laanemets
(When sending e-mail, use address arvil<Attarkon.ee)



"Bob Hoath" wrote in message
...
I have a time value in a cell (A1) formatted hh:mm. Say the value is

20:00.
In cell B1 I am trying to write a formula IF(A117:00,A1-17:00,0). This
should give me an answer 3:00 but I get error reports. I have tried
enclosing in brackets but to no avail. Any suggestions please?




  #3   Report Post  
Max
 
Posts: n/a
Default

Try instead in B1: =IF(A117/24,A1-17/24,0)
Format B1 as time ("13:30" format)

Excel stores times as a fractional portion of a 24 hour day

So 20:00 is stored as "0.8333" (=20/24)
and 17:00 as "0.70833" (=17/24)

The difference: 0.8333 - 0.7083 = 0.125
which displays as: 3:00 (in time format)

For more info, do check out Chip's:
http://www.cpearson.com/excel/datetime.htm#AddingTimes
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Bob Hoath" wrote in message
...
I have a time value in a cell (A1) formatted hh:mm. Say the value is

20:00.
In cell B1 I am trying to write a formula IF(A117:00,A1-17:00,0). This
should give me an answer 3:00 but I get error reports. I have tried
enclosing in brackets but to no avail. Any suggestions please?




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

or alternatively

=MOD(A1,--("17:00"))

--
HTH

-------

Bob Phillips
"Max" wrote in message
...
Try instead in B1: =IF(A117/24,A1-17/24,0)
Format B1 as time ("13:30" format)

Excel stores times as a fractional portion of a 24 hour day

So 20:00 is stored as "0.8333" (=20/24)
and 17:00 as "0.70833" (=17/24)

The difference: 0.8333 - 0.7083 = 0.125
which displays as: 3:00 (in time format)

For more info, do check out Chip's:
http://www.cpearson.com/excel/datetime.htm#AddingTimes
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Bob Hoath" wrote in message
...
I have a time value in a cell (A1) formatted hh:mm. Say the value is

20:00.
In cell B1 I am trying to write a formula IF(A117:00,A1-17:00,0). This
should give me an answer 3:00 but I get error reports. I have tried
enclosing in brackets but to no avail. Any suggestions please?






  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

sorry, wrong value if a1< 17:00, try this instead

=IF(A1--("17:00"),MOD(A1,--("17:00")),0)

--
HTH

-------

Bob Phillips
"Bob Phillips" wrote in message
...
or alternatively

=MOD(A1,--("17:00"))

--
HTH

-------

Bob Phillips
"Max" wrote in message
...
Try instead in B1: =IF(A117/24,A1-17/24,0)
Format B1 as time ("13:30" format)

Excel stores times as a fractional portion of a 24 hour day

So 20:00 is stored as "0.8333" (=20/24)
and 17:00 as "0.70833" (=17/24)

The difference: 0.8333 - 0.7083 = 0.125
which displays as: 3:00 (in time format)

For more info, do check out Chip's:
http://www.cpearson.com/excel/datetime.htm#AddingTimes
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Bob Hoath" wrote in message
...
I have a time value in a cell (A1) formatted hh:mm. Say the value is

20:00.
In cell B1 I am trying to write a formula IF(A117:00,A1-17:00,0).

This
should give me an answer 3:00 but I get error reports. I have tried
enclosing in brackets but to no avail. Any suggestions please?










  #6   Report Post  
Daniel.M
 
Posts: n/a
Default

Another one (just for fun)

=MAX(0,A1-"17:")

Regards,

Daniel M.

"Bob Hoath" wrote in message
...
I have a time value in a cell (A1) formatted hh:mm. Say the value is 20:00.
In cell B1 I am trying to write a formula IF(A117:00,A1-17:00,0). This
should give me an answer 3:00 but I get error reports. I have tried
enclosing in brackets but to no avail. Any suggestions please?




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
entering numbers to display a time format Ian Williams/Eazygig Excel Discussion (Misc queries) 1 January 10th 05 11:57 AM
Help - Information with time and date PM Excel Discussion (Misc queries) 4 January 6th 05 08:25 AM
time sheet Rusty Boy Excel Worksheet Functions 2 December 2nd 04 03:49 PM
Round Time cpme Excel Worksheet Functions 2 November 18th 04 07:09 PM
time formatting and time categorizing (vlookup or data validation) MarianneR Excel Worksheet Functions 4 November 18th 04 03:24 PM


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