Adjusting Time for British Summer Time

paulsolar

Well-known Member
Joined
Aug 21, 2013
Messages
682
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


DayDateTimeHeight Mts Tide State

<tbody>
</tbody>

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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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
Friday05/04/201901:121.19LowWater02:12:00changed
Saturday06/04/201901:441.09LowWater02:44:00changed
Sunday14/04/201901:447.34High Water02:44:00changed
Saturday20/04/201901:340.34LowWater02:34:00changed
Sunday28/04/201901:276.88High Water02:27:00changed
Sunday05/05/201901:121.2LowWater02:12:00changed
Monday06/05/201901:451.13LowWater02:45:00changed
Monday13/05/201901:337.68High Water02:33:00changed
Sunday19/05/201901:090.77LowWater02:09:00changed
Monday20/05/201901:490.8LowWater02:49:00changed
Tuesday28/05/201901:567.13High Water02:56:00changed
Tuesday04/06/201901:211.22LowWater02:21:00changed
Tuesday11/06/201901:148.12High Water02:14:00changed
Tuesday18/06/201901:271.25LowWater02:27:00changed
Thursday27/06/201901:567.35High Water02:56:00changed
Wednesday03/07/201901:021.24LowWater02:02:00changed
Thursday04/07/201901:491.05LowWater02:49:00changed
Thursday11/07/201901:508.13High Water02:50:00changed
Wednesday17/07/201901:101.52LowWater02:10:00changed
Thursday18/07/201901:471.44LowWater02:47:00changed
Friday02/08/201901:390.81LowWater02:39:00changed
Friday09/08/201901:147.94High Water02:14:00changed
Friday16/08/201901:301.4LowWater02:30:00changed
Sunday25/08/201901:157.27High Water02:15:00changed
Saturday31/08/201901:280.52LowWater02:28:00changed
Sunday08/09/201901:477.04High Water02:47:00changed
Saturday14/09/201901:081.31LowWater02:08:00changed
Sunday15/09/201901:391.19LowWater02:39:00changed
Sunday29/09/201901:120.37LowWater02:12:00changed
Monday30/09/201901:570.22LowWater02:57:00changed
Monday07/10/201901:096.81High Water02:09:00changed
Monday14/10/201901:121.19LowWater02:12:00changed
Tuesday15/10/201901:441.17LowWater02:44:00changed

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 
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 :LOL:

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,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

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