Hi, karldavey!
Firstly, I made many changes to your workbook in order to prepare its structure for being easily used. Here they are:
a) eliminated blank column A in sheet Week1
b) added columns to the right so as to have the same design that other WeekN sheets
c) standardized column headings, capitalization, widths and heights
d) set unmovable columns to first two (surname and forename) and rows to first one (titles)
e) trimmed leading blank space in column B for Victoria and Luke names
f) changed 'Monthly comparison' to 'Monthly comparison (%)'
g) added a Week number in auxiliary column K in cell K1
h) added a helper column in L for the accumulate thru Week n-1
i) changed 'Attendance this month (%)' to 'Attendance this week (%)'
Secondly, a couple of questions:
1) Column E, 'Attendance this month (%)', shouldn't it be 'Attendance this week (%)'? Changed.
2)Column H, Letter, what is it? Because in every WeekN sheet except Week1 you have a formula like:
=IF(ISNA('Week 1'!G2),0,('Week 1'!G2))
And 'Week 1'!G2 cell is empty, so it wouldn't ever have a not available value. That's to say that the always displays the false part of the IF statement. Maybe you wanted to ask if it was empty? If so, correct those formulas to:
=IF(ISBLANK('Week 1'!G2),0,('Week 1'!G2))
If you're not planning to place in sheet Week1 in column H (Letter) a VLOOKUP formula or any other one that could retrieve a N/A value, for WeekN sheets other than Week1 I suggest you to simply leave the formula:
='Week 1'!G2
3) 'Monthly comparison' is always performed against Week1 or should it be done against previous Week? Or both? It's a number, not a percentage? Because it has one decimal digit.
Added vs. 1st week and previous week. Left as percentage expressed as number with no decimal places.
4) 'Attendance to date' is always calculated as the average between Week1 and current week? Shouldn't it be calculated as average from Week1 to current week? It's a percentage? Because of the title, but it's expressed as a number with one decimal place.
Changed to average up to current week. Left as percentage expressed as number with no decimal places.
And at last, your main issue: how to calculate the monthly comparison without displacements in cell references when adding or removing students.
i.) formulas thru WeekN worksheets are feasible to be built, that's how there are calculated columns H:I using INDIRECT and ADDRESS functions, somehow tricky but not much... until now, everything OK
ii.) but the big issue is the row referencing when changing number of students, as you're gonna sort them alphabectically (which wouldn't happen if you simply added at the end, but I understand you can't)... first problem
iii.) using combinations of INDEX and MATCH formulas all could be solved except a clean (i.e., short and understandable formula) solution for the accumulates ranging thru WeekN sheets... second and biggest problem... so...
iv.) I recommend you to join all weeks in one sheet with the following advantages:
- you get rid of issues about referencing changed students
- you don't have to handle tricky formulas for accumulates
- you can sill have the equivalent to each Week sheet by filtering unique sheet excluding blank values
- you don't neither have to care about referencing Letter and Comment from first week nor take care of entering SurName/ForeName exactly as in first sheet... because there's only one sheet!
- I don't find any disadvantage; if you do, please advise
So you may want to analyze how 'Week 1' thru 'Week 4' sheets have been updated, then do the same with suggested 'All weeks' sheet, and after that compare and decide. In the meanwhile feel free to ask what you need.
Here's the link for the dowloadable file:
http://dl.dropbox.com/u/60558749/Comparing%20data%20that%20may%20change%20-%20Weekly%20attendance%20V2%20%28for%20karldavey%20at%20chandoo.org%29.xlsm
Please check macro assigned to button 'Sort', as it splits text from column C into A and B. I guess that it's for building the student list in two fields. You can do it in a work or auxiliary sheet and then copy paste to main sheet.
Regards!
PS: this time I absolutely underestimated the scope of the issue... but it's to late to regret, the job is yet done