This question has been asked many times before. One way is to enter the following formula in B6
and then press Ctrl+Shift+Enter:
=SUM(1/COUNTIF(B2:B5,B2:B5))
Other solutions are described at:
I prefer using a database such as LibreOffice Base instead, with a simple query:
SELECT COUNT(DISTINCT Week_Number) FROM Weeks_Table;