Besides different days for "first of week", it's also a bit surprising, how Week of Year is calculated in general.
Especially when comparing "Week of Year" and "Year Week" (from the new formula context menu).
In 2023, Rule #3 was more than 1 week delayed compared to Rule #1:
![hogi_1-1704826045502.png hogi_1-1704826045502.png](https://community.jmp.com/t5/image/serverpage/image-id/60233iF7E89008049DA79D/image-size/medium?v=v2&px=400)
![hogi_2-1704826293964.png hogi_2-1704826293964.png](https://community.jmp.com/t5/image/serverpage/image-id/60234iC8D8E41DC3327880/image-size/medium?v=v2&px=400)
New Table( "Week",
Add Rows( 30 ),
New Column( "date",
Format( "m/d/y", 12 ),
Formula( Date MDY( 1, 1, 2023 ) + (Row() - 11) * (24 * 3600) )
),
New Column( "\!"Year Week\!"",
Character,
"Nominal",
Formula(
Local(
{w = Week Of Year( :date, 3 ), y = Year( :date ), m = Month( :date )
},
If( Is Missing( :date ),
"",
Char( If( m / w >= 12, y + 1, w / m >= 52, y - 1, y ) ) ||
If( w >= 10, "W", "W0" ) || Char( w )
)
)
)
),
New Column( "Week of Year, rule1",
Formula( Week Of Year( :date ) )
),
New Column( "Week of Year, rule3",
Format( "Best", 12 ),
Formula( Week Of Year( :date, 3 ) ),
Color Cells( {32, {19, 20, 21, 22, 23, 24, 25}} )
),
New Column( "day",
Formula( Day Of Week( :date ) ),
Value Labels( {1 = "Sun", 2 = "Mon"} ),
Use Value Labels( 1 )
)
)