Excel Fox
02-22-2012, 06:24 PM
If you wanted to know the week number in a year, you'd just have to use WEEKNUM(serial_num,[return_type])
If you wanted to know the week number in a month, you could use the following formula
=IF(MONTH(A1)>1,WEEKNUM(A1,2)-WEEKNUM(DATE(YEAR(A1),MONTH(A1),0),2)+1,WEEKNUM(A1 ,2))
You could make it shorter with the EOMONTH formula as below
=IF(MONTH(A1)>1,WEEKNUM(A1,2)-WEEKNUM(EOMONTH(A1,-1),2)+1,WEEKNUM(A1,2))
For those who are inclined to the mathematics of it, you could use an even intuitive formula
=ROUNDUP((A1-EOMONTH(A1,-1))/7,0)
If you wanted to know the week number in a month, you could use the following formula
=IF(MONTH(A1)>1,WEEKNUM(A1,2)-WEEKNUM(DATE(YEAR(A1),MONTH(A1),0),2)+1,WEEKNUM(A1 ,2))
You could make it shorter with the EOMONTH formula as below
=IF(MONTH(A1)>1,WEEKNUM(A1,2)-WEEKNUM(EOMONTH(A1,-1),2)+1,WEEKNUM(A1,2))
For those who are inclined to the mathematics of it, you could use an even intuitive formula
=ROUNDUP((A1-EOMONTH(A1,-1))/7,0)