Gene,
Thanks for response. I see that you've got some responses from Bob. Here's
my take on what you have over there, and what your intent probably is ..
A sample construct is available at:
http://www.savefile.com/files/87109
YTD averaging across repeated cols.xls
Source data is assumed in a sheet named: X,
Label in B1: Oct 2006 (text), with B1's label centred across selection in
B1
1
Labels in B2
2 : Inv, Sale, Pur
Structure above is repeated (3 cols at a go) across for the full year (12
months) till col AN. The 450 items are listed in A3 down, eg: ABC, Item2,
Item3, etc.
In a new sheet Y,
Labels in B1
1 : Inv, Sale, Pur
450 items listed in A2 down: ABC, Item2, Item3, etc
(presumed to be in the same order as in X)
Inventory:
Array-entered (press CTRL+SHIFT+ENTER) in B2:
=AVERAGE(IF((MOD(COLUMN(X!B3:AN3),3)=2)*(X!B3:AN3<>""),X!B3:AN3))
will return the average of all the 12 monthly inventory cols in X (between
cols B to AN) for ABC (The average will be the "YTD" fig, assuming source
data is filled in from left-to-right in X.)
Sales:
Array-entered (press CTRL+SHIFT+ENTER) in C2:
=AVERAGE(IF((MOD(COLUMN(X!B3:AN3),3)=0)*(X!B3:AN3<>""),X!B3:AN3))
will return the average of all the 12 monthly sales cols in X (between cols
B to AN) for ABC (same formula as for inventory, except with the MOD result
=0 instead)
Purchases:
Array-entered (press CTRL+SHIFT+ENTER) in D2:
=AVERAGE(IF((MOD(COLUMN(X!B3:AN3),3)=1)*(X!B3:AN3<>""),X!B3:AN3))
will return the average of all the 12 monthly purchase cols in X (between
cols B to AN) for ABC (same formula as for inventory, except with the MOD
result =1 instead)
Then just select B2
2, copy down to return correspondingly for all the
other 450 items. Adapt to suit ..
Note: Visually check that formula is correctly array-entered. Look in the
formula bar, you should see curly braces { } wrapped around the formula.
These are auto-inserted by Excel. If you don't see these braces, you haven't
array-entered correctly. Wrong results will be returned if the formulas are
not array-entered.