Master broken into week 1, week2, etc...
I have an Access database and I'm going to have the user select a month from a dropdown on a form in the database, have a query create a new table based on that criteria, then a macro will call on a spreadsheet, which will have a database query to the newly created table... the table/master sheet will have a list of order numbers and dates and other data....
what I don't know how to do and need some direction is I need that master sheet to then be broken into 5 other sheets when the workbook is opened... sorting the data into Week 1, Week 2, Week 3, Week 4 and Week 5.
Can someone help me out or point me in the right direction?
Thank you in advance to anyone who replies :D
try weeknum() and sumproduct
Not sure if this will work in your formulas.
Try Weeknum()
it is part of the add-in for Analysis ToolPak
I use it where there is a date in column A,
Column A is a named range "jobdate"
and another column in same row put =weeknum(A1) and fill down
' this is a helper column
this helper row is named wknum
in another formula I refernece the result with sumproduct
=sumproduct(--(data1=value),--(data2=value2))
my actual code looks like this:
=SUMPRODUCT(--(Pass="x"),--(JobDate=WEEKNUM(WkStart)))
pass, jobdate and wkstart are named ranges
data1 is the range you are looking in
value 1 is what you limit the results by
if you have dats in column A from jan to aug
- the valu could be any month that falls in that range...
The true result will then compare the second criteria
Or you can just use sumproduct without the helper column
You have to name a cell as StartDate and EndDate
set up your sheet with columns where you enter a date,
- and name the range "JobDate"
in a cell you want the sum or result type:
=sumproduct(--(JobDate=>startdate),--(jobdate=<stopdate),--(check=value))
I have a few posts with this sumproduct and weeknum()
look up under mperrah
lucas, mdmcillop and charlize have all helped with this as well.
Mark