Photo by Kyle Glenn on Unsplash

How to get a date with a week number?

Using Coda to get the start and end date of week

The first day of the year

We start with the creation of the first date of the year using the below logic:

getting the first date of the year
udays to go to the start of week 2
Find the first Sunday after the first day of the year
2034 starts on a Sunday
the date of the Sunday that starts week 2
Check
Getting the start date of a week

One function

We can shorten the above logic by gluing the described steps together. I applied the step logic inside the function to keep it readable. I admit, it is a bit messy, but it does the job. The only part you have to adapt in your specific scenario is the year logic.

Concatenate(TheYear,"/01/01").ToDate().WithName(step01,step01.Weekday().WithName(Step02,7 - Step02).WithName(Step03,Sum(step01,Step03,1).ToDate())).WithName(Step05,Step05.WeekNumber().WithName(step06,If(
Product(thisRow.TheWeekNumber - step06,7) < 0,
Concatenate(TheYear,"/01/01").ToDate(),
Product(thisRow.TheWeekNumber - step06,7) + Step05)))
Christiaan on: How to get a date with a week number?

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Christiaan Huizer

I use Coda mainly for (HR) planning & (budget) calculations. Follow me to learn how to Coda with numbers. I blog at least once per week.