Home > OS >  Need Expanded EXCEL Date/Time table to include week number
Need Expanded EXCEL Date/Time table to include week number

Time:09-09

I have a Date/Time table and now need to incorporate the week number in the month (starting on Mondays) to meet certain criteria for a look up algorithm.

Google searching online I've come across this:

= WEEKNUM(DATE(YEAR($A2),1,DAY($A2-WEEKDAY($A2,3))))

The problem is that my Table starts on 1/1/2010 and when it gets to the first Monday of the month (Jan 4th) the week number rolls to 2 instead of 1

Improper roll

It resolves itself when Feb hits

enter image description here

but then hits it again (and again and again) in April

enter image description here

Now if I edit the formula to ISOWEEKNUM

= ISOWEEKNUM(DATE(YEAR(A33),1,DAY(A33-WEEKDAY(A33,3))))

it gets even more wacked

enter image description here

How to resolve this issue? Thanks!

CodePudding user response:

Just divide the DAY return by 7. Return the INT() and add 1:

=INT((DAY($A2-WEEKDAY($A2,3)))/7) 1

enter image description here

  • Related