Find week number within custom year when user enters random date

nickpape

New Member
Joined
Aug 4, 2014
Messages
4
EXCEL VERSION
Excel 2013 (15.0.4631.1000)

BACK STORY


I create weekly reports, reporting activity based on a 'Week number' defined by a custom year. Custom year = 01 SEP - 31 AUG. Each week within this custom year is defined by a week per row in a named table. E.g. Monday 02/09/2013- Sunday 08/09/2013. The row lists the week start date (Monday), end (Sunday) and defined 'Week number'.

As I have many worksheets with various data sets, all data has to have a column = week number.

WHAT I'VE DONE SO FAR

I've seen 2 approaches to this. One is to use a modular formula, the other using the following INDEX and nested IF formulas.

For example:

=INDEX(B3,MATCH(A6:C10),IF((A3)>(A6:A10)),IF((A3)<(B6:B10)),1,0)

WHERE THE CHALLENGE LIES

I am trying to figure out a modulo (or index) formula where the following user entry of a date automatically populates the corresponding 'week number'.

It is apparent I've made a botch job of the above attempt. As a result, it'd be great to get some assistance if possible!

EXAMPLE DATASET



1ABC
2USER ENTRY DATEWK
312/09/2013 <formula result="" e.g="" wk="" no="2"></formula>
5
6WK STARTWK ENDWK NO
702/09/201308/09/20131
809/09/201315/09/20132
916/09/201322/09/20133
1023/09/201329/09/2013

<tbody>
</tbody>
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Book1
FGH
171-9-201336
189-9-20131ma
1916-9-20132ma
2023-9-20133ma
2130-9-20134ma
227-10-20135ma
2314-10-20136ma
2421-10-20137ma
2528-10-20138ma
264-11-20139ma
2711-11-201310ma
2818-11-201311ma
2925-11-201312ma
302-12-201313ma
319-12-201314ma
3216-12-201315ma
3323-12-201316ma
3430-12-201317ma
356-1-201418ma
3613-1-201419ma
3720-1-201420ma
3827-1-201421ma
393-2-201422ma
4010-2-201423ma
Blad1
Cell Formulas
RangeFormula
G17=WEEKNUM(F17)
G18=IF((WEEKNUM(F18)-$G$17)<0,52+WEEKNUM(F18)-$G$17,WEEKNUM(F18)-$G$17)
G19=IF((WEEKNUM(F19)-$G$17)<0,52+WEEKNUM(F19)-$G$17,WEEKNUM(F19)-$G$17)
G20=IF((WEEKNUM(F20)-$G$17)<0,52+WEEKNUM(F20)-$G$17,WEEKNUM(F20)-$G$17)
G21=IF((WEEKNUM(F21)-$G$17)<0,52+WEEKNUM(F21)-$G$17,WEEKNUM(F21)-$G$17)
G22=IF((WEEKNUM(F22)-$G$17)<0,52+WEEKNUM(F22)-$G$17,WEEKNUM(F22)-$G$17)
G23=IF((WEEKNUM(F23)-$G$17)<0,52+WEEKNUM(F23)-$G$17,WEEKNUM(F23)-$G$17)
G24=IF((WEEKNUM(F24)-$G$17)<0,52+WEEKNUM(F24)-$G$17,WEEKNUM(F24)-$G$17)
G25=IF((WEEKNUM(F25)-$G$17)<0,52+WEEKNUM(F25)-$G$17,WEEKNUM(F25)-$G$17)
G26=IF((WEEKNUM(F26)-$G$17)<0,52+WEEKNUM(F26)-$G$17,WEEKNUM(F26)-$G$17)
G27=IF((WEEKNUM(F27)-$G$17)<0,52+WEEKNUM(F27)-$G$17,WEEKNUM(F27)-$G$17)
G28=IF((WEEKNUM(F28)-$G$17)<0,52+WEEKNUM(F28)-$G$17,WEEKNUM(F28)-$G$17)
G29=IF((WEEKNUM(F29)-$G$17)<0,52+WEEKNUM(F29)-$G$17,WEEKNUM(F29)-$G$17)
G30=IF((WEEKNUM(F30)-$G$17)<0,52+WEEKNUM(F30)-$G$17,WEEKNUM(F30)-$G$17)
G31=IF((WEEKNUM(F31)-$G$17)<0,52+WEEKNUM(F31)-$G$17,WEEKNUM(F31)-$G$17)
G32=IF((WEEKNUM(F32)-$G$17)<0,52+WEEKNUM(F32)-$G$17,WEEKNUM(F32)-$G$17)
G33=IF((WEEKNUM(F33)-$G$17)<0,52+WEEKNUM(F33)-$G$17,WEEKNUM(F33)-$G$17)
G34=IF((WEEKNUM(F34)-$G$17)<0,52+WEEKNUM(F34)-$G$17,WEEKNUM(F34)-$G$17)
G35=IF((WEEKNUM(F35)-$G$17)<0,52+WEEKNUM(F35)-$G$17,WEEKNUM(F35)-$G$17)
G36=IF((WEEKNUM(F36)-$G$17)<0,52+WEEKNUM(F36)-$G$17,WEEKNUM(F36)-$G$17)
G37=IF((WEEKNUM(F37)-$G$17)<0,52+WEEKNUM(F37)-$G$17,WEEKNUM(F37)-$G$17)
G38=IF((WEEKNUM(F38)-$G$17)<0,52+WEEKNUM(F38)-$G$17,WEEKNUM(F38)-$G$17)
G39=IF((WEEKNUM(F39)-$G$17)<0,52+WEEKNUM(F39)-$G$17,WEEKNUM(F39)-$G$17)
G40=IF((WEEKNUM(F40)-$G$17)<0,52+WEEKNUM(F40)-$G$17,WEEKNUM(F40)-$G$17)
H18=TEXT(WEEKDAY(F18),"ddd")
H19=TEXT(WEEKDAY(F19),"ddd")
H20=TEXT(WEEKDAY(F20),"ddd")
H21=TEXT(WEEKDAY(F21),"ddd")
H22=TEXT(WEEKDAY(F22),"ddd")
H23=TEXT(WEEKDAY(F23),"ddd")
H24=TEXT(WEEKDAY(F24),"ddd")
H25=TEXT(WEEKDAY(F25),"ddd")
H26=TEXT(WEEKDAY(F26),"ddd")
H27=TEXT(WEEKDAY(F27),"ddd")
H28=TEXT(WEEKDAY(F28),"ddd")
H29=TEXT(WEEKDAY(F29),"ddd")
H30=TEXT(WEEKDAY(F30),"ddd")
H31=TEXT(WEEKDAY(F31),"ddd")
H32=TEXT(WEEKDAY(F32),"ddd")
H33=TEXT(WEEKDAY(F33),"ddd")
H34=TEXT(WEEKDAY(F34),"ddd")
H35=TEXT(WEEKDAY(F35),"ddd")
H36=TEXT(WEEKDAY(F36),"ddd")
H37=TEXT(WEEKDAY(F37),"ddd")
H38=TEXT(WEEKDAY(F38),"ddd")
H39=TEXT(WEEKDAY(F39),"ddd")
H40=TEXT(WEEKDAY(F40),"ddd")
 
Upvote 0
Thanks. That is perfect. Had a mishap as I used the WEEKNUM as an absolute reference, not dynamic as per the example above. You have made me think much more. Thank you for your assistance. Greatly appreciated.

My dashboards about about to get that much better!
 
Upvote 0

Forum statistics

Threads
1,215,410
Messages
6,124,755
Members
449,187
Latest member
hermansoa

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top