List of ISO week numbers between 2 dates

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
718
Office Version
  1. 365
Platform
  1. Windows
Hello,

I need help with a formula that will give me a list of the ISO week numbers between 2 dates.

Customer Part Analysis Dashboard.xlsm
ABCD
1Todays date2021-03-18Week Number List
2Year Selected202153
3Input Date Range44197442271
42
53
64
Graph Data
Cell Formulas
RangeFormula
B1B1=TODAY()


1616075913632.png


Thank you to anyone who can help! :)

Note: The 2 dates are linked cells from a combo box so they come through in that format - as a value, but my other formulas compensate for the format so I need the Week number formula to be able to do the same.
 

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
718
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
Looks like my update affected more than I thought. As soon as I refreshed the combo box, the dates came through on the linked cells completely different so the formula broke.

Customer Part Analysis Dashboard.xlsm
ABCD
1Today's date2021-03-18Week Number List
2Year Selected2021#VALUE!
3Input Date RangeMarch 1,2021March 31,2021#VALUE!
4#VALUE!
5#VALUE!
6#VALUE!
7#VALUE!
8#VALUE!
9#VALUE!
10#VALUE!
11#VALUE!
12#VALUE!
Graph Data
Cell Formulas
RangeFormula
B1B1=TODAY()
D2:D12D2=IF(VALUE($B$3)+ROWS(D$2:D2)*7-7>VALUE($C$3),"",ISOWEEKNUM(VALUE($B$3)+ROWS(D$2:D2)*7-7))
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
718
Office Version
  1. 365
Platform
  1. Windows
On the combo box there is a VBA formula to convert the number date to something the user can read instead of 44197 for example.

VBA Code:
Private Sub Date_End_Click()
ActiveSheet.Date_End.Value = Format(ActiveSheet.Date_End.Value, "mmmm d,yyyy")
End Sub

However when I link the combo box result to a cell I get a value a formula cannot recognize. I don't know how to resolve this....Should I make a new post or is this a quick fix?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,407
Office Version
  1. 365
Platform
  1. Windows
No need, just use
VBA Code:
Private Sub Date_End_Click()
ActiveSheet.Date_End.Value = Format(ActiveSheet.Date_End.Value, "mmmm d,yyyy")
Range("c3") = CDate(Me.Date_End)
End Sub
 

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
718
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

No need, just use
VBA Code:
Private Sub Date_End_Click()
ActiveSheet.Date_End.Value = Format(ActiveSheet.Date_End.Value, "mmmm d,yyyy")
Range("c3") = CDate(Me.Date_End)
End Sub
Didn't fix the issue. I switched to the standard combo box but still cannot get the linked cell to display properly. I made a new post.
I hope I can figure this out as my whole sheet relies on the combo box input for dates.
 

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
718
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

I honestly don't know which combo box to use as both are not working. The formula you gave me above does work for the linked cell but the combo box itself went back to a number (44197) so no idea what to do 😔

Also the formulas you gave me for the week numbers are not stopping at 4 again with the new date formats. 😔 😔
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,407
Office Version
  1. 365
Platform
  1. Windows
the formulas you gave me for the week numbers are not stopping at 4 again with the new date formats.
That's probably because your "dates " are in fact text
 

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
718
Office Version
  1. 365
Platform
  1. Windows
I got everything working minus the combo boxes displaying Month day year instead of a number. Not sure how to fix that as the code you gave me successfully converts the linked cell but in doing so changes what is displayed in the combo box (Active X combo box)

VBA Code:
Private Sub Date_End_Click()
ActiveSheet.Date_End.Value = Format(ActiveSheet.Date_End.Value, "mmmm d,yyyy")
Range("c3") = CDate(Me.Date_End)
End Sub

I don't know how to make the formulas that the combo box is using as it's list recognized as dates instead of text however...
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,407
Office Version
  1. 365
Platform
  1. Windows
As you have already started a new thread for this part, you need to stick to it. Thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,129,301
Messages
5,635,408
Members
416,856
Latest member
silentir

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top