ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I create a formula to add hours to a mm/dd/yy h:mm format c (https://www.excelbanter.com/excel-programming/413389-how-do-i-create-formula-add-hours-mm-dd-yy-h-mm-format-c.html)

bm05

How do I create a formula to add hours to a mm/dd/yy h:mm format c
 
I wish to create a tide predictor. I have the stated date/time for High and
Low tide. I wiould like to create a formula to add/subtract hours based on
different locations in the region.

Ft. Mchenry - High Tide 7/01/2008 01:20
new location Sandy Pt. is Ft Mchenry High Tide plus 2 hours (should equal
7/01/2008 03:20)

Franz Erhart

How do I create a formula to add hours to a mm/dd/yy h:mm format c
 
Just add 0.0416666666 to the value of Ft. Mchenry

formated as number:
39672,0000000000
39672,0416666666

formated as date/time
12.08.2008 00:00
12.08.2008 01:00



"bm05" wrote:

I wish to create a tide predictor. I have the stated date/time for High and
Low tide. I wiould like to create a formula to add/subtract hours based on
different locations in the region.

Ft. Mchenry - High Tide 7/01/2008 01:20
new location Sandy Pt. is Ft Mchenry High Tide plus 2 hours (should equal
7/01/2008 03:20)


Peter T

How do I create a formula to add hours to a mm/dd/yy h:mm format c
 
Sub test()
Dim dt1 As Date, dt2 As Date
dt1 = DateSerial(2008, 7, 1) + TimeSerial(1, 20, 0) 'y,m,d + h,m,s

dt2 = dt1 + TimeSerial(2, 0, 0)

MsgBox Format(dt1, "mmm/d/yy h:m") & vbCr & _
Format(dt2, "mmm/d/yy h:m")

End Sub



"bm05" wrote in message
...
I wish to create a tide predictor. I have the stated date/time for High

and
Low tide. I wiould like to create a formula to add/subtract hours based

on
different locations in the region.

Ft. Mchenry - High Tide 7/01/2008 01:20
new location Sandy Pt. is Ft Mchenry High Tide plus 2 hours (should equal
7/01/2008 03:20)





All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com