Blog
Dates - How to calculate UK tax weeks
If you need to convert dates to UK tax weeks or generate a list of the start and end dates for tax weeks in a year, this post describes some formula that you can use.
How do UK tax weeks and numbers work?
The HMRC site best describes how UK tax weeks and numbers work.
Income Tax weeks (tax weeks) are periods of 7 days which follow on from each other starting on 6 April each year. The first tax week is 6 April to 12 April inclusive, the second tax week is 13 April to 19 April inclusive, and so on.
The odd day or days at the end of the last complete tax week in the year, (5 April or in leap years, 4 April and 5 April) are treated as a whole tax week, which is tax week 53.
Income Tax months (tax months)
Income Tax months are periods following on from each other in an Income Tax year. They start on the sixth of one month and finish on the fifth of the following month. The first Income Tax month is 6 April to 5 May inclusive, the second Income Tax month is 6 May to 5 June inclusive, and so on.
An easy way to visualise the above is through a tax calendar, such as the one from Sage shown below.
How to generate a list of the start and end dates for UK tax weeks
Effectively, UK tax weeks always start on the 6th April. Week 2 starts 7 days after 6th April, and so on until the 5th April for the following year.
Here is the formula to create a list of UK tax weeks for the financial year 2022.
ClearCollect(The above formula collects the tax weeks into a collection called colTax. Here's how the result looks when we display the result in a data table.
colTax,
With(
{
startDate: Date(2022, 4, 6)
},
ForAll(
Sequence(53),
{
WeekNum: Value,
StartDate: DateAdd(
startDate,
(Value - 1) * 7
),
EndDate: Min(
DateAdd(
startDate,
(Value * 7) - 1
),
DateAdd(
DateAdd(startDate, 1, Years),
-1, Days
)
)
}
)
)
)
How to get the UK tax week number for an input date (based on a specific tax year)
Since UK tax weeks always begin on 6th April, we can make this calculation by working out the number of days that have elapsed since 6th April. We then work out the number of weeks by dividing by 7 and that will give us the tax week number. Since the first week is week 1, we must round up to the next highest number.
The formula to derive the week number for the tax year 2022-2023 looks like this:
RoundUp(DateDiff(Date(2022,04,05),
dpTaxInput.SelectedDate, Days)/7,
0
)
How to get the UK tax week number from an input date (generic formula)
With({inputDate:dpTaxInput.SelectedDate},
With({taxYearStart:
If(Month(inputDate) >=4 && Day(inputDate) >5,
Date(Year(inputDate),04,05),
Date(Year(inputDate)-1,04,05))
},
RoundUp(DateDiff(taxYearStart,
inputDate,Days)/7, 0
)
)
)
Conclusion
This post demonstrated formula to calculate the UK tax week for a given input date and to generate a list of the start and end dates for tax weeks in a year, These types of calculations can be very useful when building financial type apps.- Categories:
- dates
- Dates - How to convert a month name (eg January, Feburary, March) to month number (eg, 1, 2, 3)
- Dates - How to format date day numbers with suffix (st nd rd th)
- Formula - How to get the dates for the current week
- Dates - How to convert dates from MM DD YYYY to DD MM YYYY and vice versa
- Dates - How to detect overlapping times / scheduling conflicts
- Dates - How to display or convert Excel date serial numbers
- Dates - How to get the start date from week number
- Dates - How to check if a year is a leap year
- Dates - How to get the week number for a given date
- Dates - How to get the nth weekday for a month
- Dates - How to get the last weekday for a month
- Dates - How to get a numbered list of days or months, starting from a specified day or month
- Controls - How to display dates in a combo box
- Search - How to filter records by month and year using a delegable expression