Adjusting Time for British Summer Time

paulsolar

Well-known Member
Joined
Aug 21, 2013
Messages
696
Office Version
  1. 365
Hi All

I think this is a question to test the chaps who specialise in difficult formula

I am working on something that requires me to adjust tide times from UTC to a format that accommodates the seasonal changes in the UK for British Summer Time. Below is an explanation from the UK Government of this.
"In the UK the clocks go forward 1 hour at 1am on the last Sunday in March, and back 1 hour at 2am on the last Sunday in October.
The period when the clocks are 1 hour ahead is called British Summer Time (BST). There’s more daylight in the evenings and less in the mornings (sometimes called Daylight Saving Time).
When the clocks go back, the UK is on Greenwich Mean Time (GMT)."

I have a spreadsheet with the information which has at the moment 5 columns


[TABLE="width: 393"]
<tbody>[TR]
[TD="class: xl64, width: 80"]Day[/TD]
[TD="class: xl63, width: 99"]Date[/TD]
[TD="class: xl63, width: 64"]Time[/TD]
[TD="class: xl63, width: 74"]Height Mts[/TD]
[TD="class: xl63, width: 76"] Tide State[/TD]
[/TR]
</tbody>[/TABLE]

where Day is say Wednesday
where Date is say 16/01/2019 (UK format, dd/mm/yyyy)
where Time is say 14:51:00
where Height Mts is the height of Low or High Water
where Tide State is either Low Water or High Water

What I want to do is use a formula in Column F that will add the one hour where required year on year to save me having to do it manually as I have to calculate lock closure based tide heights and times.

I'm convinced that it is possible but try as I might I cannot get it to work.

Any help would be greatly appreciated. I dont mind either a vba or formulaic solution.

Thanks in advance

cheers

Paul
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Paul - so presumably your source data time is in UTC / GMT, yes ?

And the problem boils down to identifying whether the date / time for each entry is within BST, in which case add an hour.

Adding an hour is easy - it's just your original time plus 1/24 (assuming your data is stored as an Excel time value, not a text string).
 
Upvote 0
Hi Gerald

You have hit the nail on the head. The dates and times are stored as excel (time is UTC as you suspected albeit it's only when we add the hour the UCT and GMT vary from each other for my purposes)

I'm struggling with the change over times when the hour is added at 1am and back to UTC at 2am on the last Sundays. It is important that I get this correct as it has a knock on effect to the lock closure times if they fall between these periods.

so for example, the lock is closed at 1am and would reopen say 3am but if the these times fall in this range on the first Sunday they would now be 1am and reopen at 4am. if this happens at the return to UTC it would be 1am and reopen 2am

hope that explains it a bit better
 
Upvote 0
sorry Gerald, it can be done manually but i want to automate the whole process
 
Upvote 0
Whilst there's probably a simpler way, how about
Code:
=IF(AND(AND(B2>=EOMONTH(DATE(YEAR($B2),3,1),0)-MOD(WEEKDAY(EOMONTH(DATE(YEAR($B2),3,1),0),11),7),C2>(1/24)),B2<=EOMONTH(DATE(YEAR($B2),10,1),0)-MOD(WEEKDAY(EOMONTH(DATE(YEAR($B2),10,1),0),11),7),C2<(2/24)),C2+(1/24),C2)
 
Last edited:
Upvote 0
Hi Fluff

Long time no bother. How are you keeping? wont be long till the 6 nations now :)

I think you are almost correct.

I've sorted the dates that have changed. Column D is tide height

I've had a little play with the formula, but not sure what I'm doing, as always you have me baffled using functions I've never seen

cheers

Paul
[TABLE="width: 555"]
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Friday[/TD]
[TD]05/04/2019[/TD]
[TD]01:12[/TD]
[TD]1.19[/TD]
[TD]LowWater[/TD]
[TD]02:12:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Saturday[/TD]
[TD]06/04/2019[/TD]
[TD]01:44[/TD]
[TD]1.09[/TD]
[TD]LowWater[/TD]
[TD]02:44:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Sunday[/TD]
[TD]14/04/2019[/TD]
[TD]01:44[/TD]
[TD]7.34[/TD]
[TD]High Water[/TD]
[TD]02:44:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Saturday[/TD]
[TD]20/04/2019[/TD]
[TD]01:34[/TD]
[TD]0.34[/TD]
[TD]LowWater[/TD]
[TD]02:34:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Sunday[/TD]
[TD]28/04/2019[/TD]
[TD]01:27[/TD]
[TD]6.88[/TD]
[TD]High Water[/TD]
[TD]02:27:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Sunday[/TD]
[TD]05/05/2019[/TD]
[TD]01:12[/TD]
[TD]1.2[/TD]
[TD]LowWater[/TD]
[TD]02:12:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[TD]06/05/2019[/TD]
[TD]01:45[/TD]
[TD]1.13[/TD]
[TD]LowWater[/TD]
[TD]02:45:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[TD]13/05/2019[/TD]
[TD]01:33[/TD]
[TD]7.68[/TD]
[TD]High Water[/TD]
[TD]02:33:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Sunday[/TD]
[TD]19/05/2019[/TD]
[TD]01:09[/TD]
[TD]0.77[/TD]
[TD]LowWater[/TD]
[TD]02:09:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[TD]20/05/2019[/TD]
[TD]01:49[/TD]
[TD]0.8[/TD]
[TD]LowWater[/TD]
[TD]02:49:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Tuesday[/TD]
[TD]28/05/2019[/TD]
[TD]01:56[/TD]
[TD]7.13[/TD]
[TD]High Water[/TD]
[TD]02:56:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Tuesday[/TD]
[TD]04/06/2019[/TD]
[TD]01:21[/TD]
[TD]1.22[/TD]
[TD]LowWater[/TD]
[TD]02:21:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Tuesday[/TD]
[TD]11/06/2019[/TD]
[TD]01:14[/TD]
[TD]8.12[/TD]
[TD]High Water[/TD]
[TD]02:14:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Tuesday[/TD]
[TD]18/06/2019[/TD]
[TD]01:27[/TD]
[TD]1.25[/TD]
[TD]LowWater[/TD]
[TD]02:27:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Thursday[/TD]
[TD]27/06/2019[/TD]
[TD]01:56[/TD]
[TD]7.35[/TD]
[TD]High Water[/TD]
[TD]02:56:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Wednesday[/TD]
[TD]03/07/2019[/TD]
[TD]01:02[/TD]
[TD]1.24[/TD]
[TD]LowWater[/TD]
[TD]02:02:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Thursday[/TD]
[TD]04/07/2019[/TD]
[TD]01:49[/TD]
[TD]1.05[/TD]
[TD]LowWater[/TD]
[TD]02:49:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Thursday[/TD]
[TD]11/07/2019[/TD]
[TD]01:50[/TD]
[TD]8.13[/TD]
[TD]High Water[/TD]
[TD]02:50:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Wednesday[/TD]
[TD]17/07/2019[/TD]
[TD]01:10[/TD]
[TD]1.52[/TD]
[TD]LowWater[/TD]
[TD]02:10:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Thursday[/TD]
[TD]18/07/2019[/TD]
[TD]01:47[/TD]
[TD]1.44[/TD]
[TD]LowWater[/TD]
[TD]02:47:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Friday[/TD]
[TD]02/08/2019[/TD]
[TD]01:39[/TD]
[TD]0.81[/TD]
[TD]LowWater[/TD]
[TD]02:39:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Friday[/TD]
[TD]09/08/2019[/TD]
[TD]01:14[/TD]
[TD]7.94[/TD]
[TD]High Water[/TD]
[TD]02:14:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Friday[/TD]
[TD]16/08/2019[/TD]
[TD]01:30[/TD]
[TD]1.4[/TD]
[TD]LowWater[/TD]
[TD]02:30:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Sunday[/TD]
[TD]25/08/2019[/TD]
[TD]01:15[/TD]
[TD]7.27[/TD]
[TD]High Water[/TD]
[TD]02:15:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Saturday[/TD]
[TD]31/08/2019[/TD]
[TD]01:28[/TD]
[TD]0.52[/TD]
[TD]LowWater[/TD]
[TD]02:28:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Sunday[/TD]
[TD]08/09/2019[/TD]
[TD]01:47[/TD]
[TD]7.04[/TD]
[TD]High Water[/TD]
[TD]02:47:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Saturday[/TD]
[TD]14/09/2019[/TD]
[TD]01:08[/TD]
[TD]1.31[/TD]
[TD]LowWater[/TD]
[TD]02:08:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Sunday[/TD]
[TD]15/09/2019[/TD]
[TD]01:39[/TD]
[TD]1.19[/TD]
[TD]LowWater[/TD]
[TD]02:39:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Sunday[/TD]
[TD]29/09/2019[/TD]
[TD]01:12[/TD]
[TD]0.37[/TD]
[TD]LowWater[/TD]
[TD]02:12:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[TD]30/09/2019[/TD]
[TD]01:57[/TD]
[TD]0.22[/TD]
[TD]LowWater[/TD]
[TD]02:57:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[TD]07/10/2019[/TD]
[TD]01:09[/TD]
[TD]6.81[/TD]
[TD]High Water[/TD]
[TD]02:09:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Monday[/TD]
[TD]14/10/2019[/TD]
[TD]01:12[/TD]
[TD]1.19[/TD]
[TD]LowWater[/TD]
[TD]02:12:00[/TD]
[TD]changed[/TD]
[/TR]
[TR]
[TD]Tuesday[/TD]
[TD]15/10/2019[/TD]
[TD]01:44[/TD]
[TD]1.17[/TD]
[TD]LowWater[/TD]
[TD]02:44:00[/TD]
[TD]changed[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
sorry Fluff, i added a column to show which times have changed, none of the other times changed
 
Upvote 0
Hello Paul
Bet you enjoyed the Autumns :laugh:

I would expect all those times to change as they are between 31st Mar & 27th Oct. Or have I missed something?
 
Upvote 0
Here is my take on this:

=C2+AND(B2+C2>=WORKDAY.INTL(DATE(YEAR(B2),4,1),-1,"1111110")+1/24,B2+C2 < WORKDAY.INTL(DATE(YEAR(B2),11,1),-1,"1111110")+2/24)/24
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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
Back
Top