Hi Charlie,
It is not clear how you want to add 3hr 45min to cell A1.
A1: =C1 + "3:45"
A1: =C1 + time(3,45,0)
A1: =C1+D1
the last would be preferable as people want/need to know where the
numbers come from.
If you want to add 3:45 to anything entered in A1 you would need
an Event macro. RightClick on sheetname, view code, insert your code.
To make it effective for anything in column A except row 1, remove if target.column line.
But as I indicated people aren't going to like seeing figures that
they don't know where they came from.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.row <> 1 Then Exit Sub
If Target.Column <> 1 Then Exit Sub
Application.EnableEvents = False 'should be part of Change macro
Target.Value = Target.Value + TimeSerial(3, 45, 0)
Application.EnableEvents = True 'should be part of Change macro
End Sub
More information on Event Macros in
http://www.mvps.org/dmcritchie/excel/event.htm
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
CharlieAZ said:
Hi David,
Many thanks for the reply. I am new to this style forum so it took me a
few days to get your reply even though you answered me back right away.
Anyway that solution worked. Now if I may I have another question.
Say I have cell A1=13:51:41.1 (24 hour time) I would like to add say 3
hours 45 minutes to that time and redisplay the new time. Is this possible in
Excel 2000 or will it require a visual basic macro or some other method to
solve it? Any help would be appreciated.
Thanks, Charlie
David McRitchie said:
Hi Charlie,
I'm surprised I guess just use
d hh:mm:ss
good up to 31 days.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
Hi David,
I Tried to put in the Format [d] hh:mm:ss, but Excel 2000 does not except
it. Is this format for a version of Excel above 2000 and would you know a
work around for Excel 2000? Any help you can provide would be greatly
appreciated.
Thanks, Charlie
:
In Excel time is a fraction of a day so you would have to divide by 24
there are 86400 seconds in a day (24*60*60) so your number
actually represents a few days.
=A1/86400 format as [d] hh:mm:ss if you want to see days
format as [h]:mm:ss if you don't want hours to overflow into days.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
I've done some reading, but can't find the same problem as mine exactly.
cell A1 =463237 seconds.
I want to display this as: hh:mm:ss, but not in 24 hour clock. Meaning, I want to see 128 hours:33 minutes: 32 seconds (not
proper figures I know).
The formula I am tyring to use is: =TEXT(C3/24,"h:mm:ss"), but it doesn't seem to work the way I want.
Anybody???