Получено с помощью vba.Один - это макрос, а другой - udf.
Макрос
Sub getWeekDays()
Dim vDB, vS(), vR()
Dim y As Integer, s As Date, e As Date
Dim i As Integer, k As Integer
Dim n As Integer
'y = Year
y = InputBox("Input year : 2018 ")
s = DateSerial(y, 1, 0)
e = DateSerial(y + 1, 1, 0)
n = e - s
For i = 1 To n
d = s + i
If DatePart("ww", d, vbMonday) = DatePart("ww", d + 1, vbMonday) Then
Else
k = k + 1
ReDim Preserve vR(1 To 2, 1 To k)
vR(1, k) = DatePart("ww", d, vbMonday) & " Wk"
If k = 1 Then
vR(1, k) = DatePart("ww", s + 1, vbMonday) & " Wk"
vR(2, k) = Format(s + 1, "dd.mm.yyyy") & "~" & Format(d, "dd.mm.yyyy")
Else
vR(2, k) = Format(d - 6, "dd.mm.yyyy") & "~" & Format(d, "dd.mm.yyyy")
End If
End If
Next i
Range("a1").CurrentRegion.Clear
Range("a1").Resize(k, 2) = WorksheetFunction.Transpose(vR)
End Sub
UDF
Function getWeekDay(y As Integer, WeekNum As Integer, DayOrder As Integer)
Dim s As Date, e As Date
Dim i As Integer
Dim n As Integer
Application.Volatile
'WeekNum = 51
'y = Year
'DayOrder <~~ If third day DayOrder = 3
s = DateSerial(y, 1, 0)
e = DateSerial(y + 1, 1, 0)
n = e - s
For i = 1 To n
d = s + i
If DatePart("ww", d, vbMonday) = WeekNum Then
getWeekDay = d + DayOrder - 1
Exit Function
End If
Next i
End Function