kayaker246
New Member
- Joined
- Nov 20, 2009
- Messages
- 4
The post title basically sums up my issue. I have two lists of numbers, A & B. A are basically categories, we'll say all the values are either 1, 2 or 5 (anyone get the joke?). B contains values that need to be averaged. The hitch is that there are basically three averages. Those numbers in column B whose corresponding value in column A is 1 need be averaged together, and the same for B column values corresponding to 2 and 5.
I entered the formula in VBA using HHGRng.Formula = Averageif($blah:$blee, blah, $gobble:$bobble) where blah:blee is the range to test in column A and gobble:bobble is the range to average in column B.
However, I learned - to my dismay - that Averageif isn't supported in XL 2003. The horror! So instead I did HHGRng.FormulaArray = Average(If($blah:$blee=blah,$gobble:$bobble,FALSE)).
Unfortunately, excel doesn't update the relative 'blah' reference for the Array Formula as it does for the averageif function. This is annoying.
My question is this: can I get the 'blah' reference to be adjusted appropriately for each subsequent cell in HHGRange without resorting to a loop function and manually incrementing the row?
Thanks!
'yakker
I entered the formula in VBA using HHGRng.Formula = Averageif($blah:$blee, blah, $gobble:$bobble) where blah:blee is the range to test in column A and gobble:bobble is the range to average in column B.
However, I learned - to my dismay - that Averageif isn't supported in XL 2003. The horror! So instead I did HHGRng.FormulaArray = Average(If($blah:$blee=blah,$gobble:$bobble,FALSE)).
Unfortunately, excel doesn't update the relative 'blah' reference for the Array Formula as it does for the averageif function. This is annoying.
My question is this: can I get the 'blah' reference to be adjusted appropriately for each subsequent cell in HHGRange without resorting to a loop function and manually incrementing the row?
Thanks!
'yakker
Last edited: