I need a formula that will find the week number of a month. Sometimes, there are 5 weeks in a month and I need the formula to be able to adapt to that. I want to take the data out of one cell that has a date in it. My workplace has Excel 2003, and I can't use any macros or add-ins. The formula needs to be made from existing formulas in Excel 2003.
For example: The date I am referencing for the formula is January 1, 2012. I need the formula to reflect that this is week 1, but just the number, not the word week. If I were to reference the same cell that originally had January 1st in it with a different date, say February 29, 2012, then I need the formula to display that this is week 5.
I define the first or last week of a month by whatever month has the most days in the week. For January of this year - the 29th, 30th, and 31st are in the first week of February because February has 4 out of 7 days in the week.
Hi Jerse.. Welcome to the forum.
This is a formula by Daddylonglegs & appears to do exactly what you're after
If the formula's in B1 & you enter a date in A1, B1 will show the week number=IF(A1="","",INT((A1-WEEKDAY(A1,2)-DATE(YEAR(A1+4-WEEKDAY(A1,2)),1,4))/7)+2)
Have fun
hey philb1,
thanks for the response and the welcome! however, i'm looking for a formula that will only display the numbers 1-5 for the week numbers. having the week number of a particular month, not the year, is what i'm trying to get at. i'd also like the formula to understand that the first day of the week is sunday.
another example: february 1st, 2012 - which falls on a wednesday - is in week 1 of february, while march 1st, 2012 - which falls on a thursday - is considered to be in week 5 of february because the last days of february take up 4/7 days of the week while the first days of march only take up 3/7 days of the same week.
Perhaps this link could be of help?
http://office.microsoft.com/en-us/ex...005209337.aspx
Alf
her alf,
thanks, but the weeknum function in excel 2003 is only available by using the add-in.
ive literally been thinking about how to do this for the past few hours but can't get around it without creating an additional table with all the dates and week numbers all ready inside of it...
Try this formula
=INT((6+DAY(A1-WEEKDAY(A1)+4))/7)
Audere est facere
Hey Jerse and welcome to the forum,
Try
for the week of a date in its month.=INT((DAY(A2)+WEEKDAY(DATE(YEAR(A2),MONTH(A2),1))-2)/7)+1
See the attached with examples and the above formula.
One test is worth a thousand opinions.
Click the * below to say thanks.
Hey Jerse,
I tried DLL's formula above in column F of my workbook below and couldn't get my answers.
I guess I didn't understand the problem.
Is Dec 3, 2011 in week 1 and Dec 4, 2011 in week 2?
What was I missing? Did you try my formula and sheet below?
One test is worth a thousand opinions.
Click the * below to say thanks.
Marvin,
I believe that every week should have 7 days, starting on Sunday and ending on Saturday. The only issue then is where week 1 starts. Jerse's stipulation is that week 1 is the first week with most of the days in the relevant month, so that means week 1 starts with the first Sunday that occurs on or after 1st of month -3
Note that my formula should work for any date, A1 doesn't need to be a Wednesday
Audere est facere
Hey DLL,
Thanks - My assumption was different than your above. Looking at December 2011, I had the first three days in week 1 with Dec 4th being in week 2.
This reminds me of people who say "next Thursday". Some mean in a few days and others mean the Thursday after the next Thursday.
Thanks for the answer - I was just wrong with what was meant by "first week".
One test is worth a thousand opinions.
Click the * below to say thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks