View Single Post
  #5   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?

Hi John

If I was trying to get to where you are trying to get to I wouldn't
start from where you are!

The fact that months are not 28 days long makes solutions more
difficult than they need be.

I would keep *all* my time in one worksheet and produce different views
of it for different purposes, using filtering.

I would have columns (e.g.)
Date Month Week Day In_1 Out_1 In_2 Out_2 Hours
6Jan08 Jan-08 6Jan08 Sun 8:00 12:00 4
7Jan08 Jan-08 6Jan08 Mon 8:00 12:00 13:00 17:00 8
8Jan08 Jan-08 6Jan08 Tue 8:00 12:00 13:00 17:30 8.5
etc.

The month column (say in row 2) would contain
=TEXT(A2,"mmm-yy")
The week [commencing] column would contain
=TEXT(A2-WEEKDAY(A2)+1,"dmmmyy")
The day column would contain
=TEXT(A2,"ddd")
The hours formula could be copied from your current timesheet

All these formulas can be copied down

The date column would contain date values formatted whatever way you
prefer. A2 would have the date of the first record
A3 would contain =A2+1 and this formula could be copied down the rest
of the column

Beneath the table, following at least one empty row, in the Hours
column (say it's column I, row 100) I would put the following formula
=SUBTOTAL(9, $I$1:$I$99)

This works like SUM($I$1:$I$99) but when the table is filtered it will
only add up the visible rows.

Then I would use Data Filter AutoFilter to get drop arrows at the
top of each column.

By selecting Jan-08 in the month column I would get the monthly
timesheet for Jan, and the subtotal formula would give me the total
hours for the month.

By selecting All in the Month column and 6Jan08 in the Week column I
would get the weekly timesheet for that week and the sub-total formula
would give the total hours for the week.

If, for any reason, you ever wanted to get the total of hours worked on
Sundays you could use filtering on the Day column to do that.

If that makes sense to you, go with it.
If it doesn't, I think the alternatives would be too difficult to
describe in a message such as this.

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