Does anyone know how to convert a WEEKNUM num...

Does anyone know how to convert a WEEKNUM number and year to a date, so as to give the โ€˜week commencingโ€™ date?

Iโ€™ve found expression for Googlesheets and excel but they donโ€™t even begin to work in appsheet.

Thanks!

0 6 1,020
6 REPLIES 6

Iโ€™m afraid we donโ€™t have direct tool for that, but you can create that quite easily by yourself. Add one small table with two columns like [Date] and [Year]. For this table add the date of Monday when the week is 1. Then you can calculate what ever date when week number is known.

Thanks Aleksi.

Is there no expression which will yield the week commencing date?

In excel the expression is:

=DATE(A2, 1, -2) - WEEKDAY(DATE(A2, 1, 3)) + B2 * 7

where A2 is the year and B2 is the weeknumber. G-sheets has a similar expression.

Aaaโ€ฆ I thought you were asking an expression that would solve the date directly. You can do the same with something likeโ€ฆ DATE(CONCATENATE(โ€œ12/29/โ€,[YEAR]-1)) - WEEKDAY(DATE(CONCATENATE(โ€œ1/3/โ€,[YEAR])))+(7*[Week]). Havenโ€™t tested but it should work.

Hi @Aleksi ,

How would I go about displaying this in โ€œdd/mm/yyyyโ€ format?

Iโ€™ve tried with wrapping in text() but unsuccessful.

text(DATE(CONCATENATE(โ€œ12/29/โ€,YEAR([Date])-1)) - WEEKDAY(DATE(CONCATENATE(โ€œ1/3/โ€,YEAR([Date]))))+(7*weeknum([Date])),โ€œdd/mm/yyyyโ€)

Thanks,
Chris.

I have absolutely NO IDEA how your brain works but WOW!

Thanks a million.

By the way, are you doing this in your sleep?!

Sometimes yes Actuallyโ€ฆ you just need to think how you can achieve the requested functionality step by step.

Top Labels in this Space