简体   繁体   中英

Excel formula: Find Date from Weeknum and weekday

I am trying to find the date out of a weeknum, weekday and year.

There are many information on the web but after several attempts, I couldn't find what I was looking for.

So far, I have this formula:

=DATE(AZ22,1,AZ3*7-5)-WEEKDAY(DATE(AZ22,1,3))
  • AZ22=YEAR
  • AZ3=WEEKNUM

Unfortunately it doesn't seem to work. In order to add some complexity, my weeks should start for Thursday (Thursday 1st day of the week).

If you are so kind to provide an answer, could you please post the explanation of the formula as well?

as JvdV asked, the output should be a date like 01 dec 2019. I need this formula to map a current date (and I can't use date-364) with the last two years.

The process works as follow:

  • I have the current date (date A)
  • The current week ( of date A) is mapped with a different week last year
  • From the week (and eventually the WEEKDAY) I should find my date B

    I hope it clarifies my request

Thank you,

Use this:

=DATE(A2,1,(B2-1)*7-WEEKDAY(DATE(A2,1,B2*7),14)+C2)

This is just math. But by adding the 14 to the Weekday we start our week on Thursday. This does assume that 2019-1-3 , the first Thursday of this year, is the start of the 2nd week. If that is not the case and the week that started on the 3rd is the first week, change the (B2-1) to just B2

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM