View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.links
Bill Manville Bill Manville is offline
external usenet poster
 
Posts: 473
Default MS: Excel: Formula for data duplication between sheets?

It is difficult to advise without knowing the layout of your monthly
timesheet. You haven't given us enough clues to be able to divine it.
Nor do we know how you want the weekly timesheet laid out.

For example, your timesheet might be like this:

Date Hours Comment
1-Jan 4.5 "This is what I did"
2-Jan 8.5 "Cleared snow"

etc. with a separate sheet for each month.

and you might want a similar format for the weekly presentation but
with just 7 days.

Here is a possible approach:

The weekly sheet contains the week start date in A2, e.g. 7-Jan-2008
A3 contains =A2+1 and this is copied down as far as A8 (which will then
contain =A7+1). By changing A2 you will get a different week showing
up.

Now in B2 of the weekly sheet we want to get the hours for 7-Jan (or
whatever the date is in A2). We could use
=OFFSET(JanSheet!B$1,DAY($A2),0)
where JanSheet is the name of January's monthly timesheet.
This will give us the value of the cell 7 rows down from B1 on JanSheet
(ie the hours for 7-Jan)

We could copy this formula to B2:C8 and we would have the week's time
data. Change A2 to 14-Jan-2008 and we get a different week's data.

An obvious problem will arise at the end of a month when the data for a
week has to come from 2 sheets. You could edit the formulas so that
for the February dates they reference FebSheet, but smarter would be to
get the formulas to adjust themselves using the INDIRECT function. You
could make B2 on the weekly sheet contain
=OFFSET(INDIRECT(TEXT($A2,"mmm")&"Sheet!A$1"),DAY( $A2),COLUMN()-1)









Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup