Login Page - Create Account

Support Board


Date/Time: Thu, 06 Feb 2025 00:51:58 +0000



Post From: Study Alert Question

[2020-04-06 12:55:33]
Sawtooth - Posts: 4169
This returns the week number of the 1st of the month, and its value is persistent until the 1st of the subsequent month:
WEEKNUM(DATE(YEAR(BARDATE),MONTH(BARDATE),1))

So to get the 1st week of the month, compare it to the previous bar:
=WEEKNUM(DATE(YEAR(BARDATE),MONTH(BARDATE),1))<>WEEKNUM(DATE(YEAR(BARDATE[-1]),MONTH(BARDATE[-1]),1))

The spreadsheet formula would look like this:
=WEEKNUM(DATE(YEAR(A3),MONTH(A3),1))<>WEEKNUM(DATE(YEAR(A4),MONTH(A4),1))