tora111
asked on
AVERAGEIF
=AVERAGEIF(B:B,"aa",A:A)+A VERAGEIF(C :C,"aa",A: A)
...Hey Saqib!.....but won't that give you 1+4 = 5?
To get the average overall try an array formula e.g.
=AVERAGE(IF(B1:C5="aa",A1: A5))
confirmed with CTRL+SHIFT+ENTER
regards, barry
To get the average overall try an array formula e.g.
=AVERAGE(IF(B1:C5="aa",A1:
confirmed with CTRL+SHIFT+ENTER
regards, barry
ASKER
I forgot to say why your initial AVERAGEIF function doesn't work - AVERAGEIF works on a 1 cell to 1 cell basis so even though you only used A:A as the range to average your average range is actually 2 columns so when C3 is "aa" the formula is trying to add B3 (not A3) to the average (and because that's text it's ignored)
See workbook attached
regards, barry
averages.xls
See workbook attached
regards, barry
averages.xls
ASKER
ssaqibh,
=AVERAGEIF(B:B,"aa",A:A)+A VERAGEIF(C :C,"aa",A: A) = 5
It's not = 3
=AVERAGEIF(B:B,"aa",A:A)+A
It's not = 3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Barry,
So I must separate each columns (b, c). If I have more columns, then I need to add it 1 by 1, right?
So I must separate each columns (b, c). If I have more columns, then I need to add it 1 by 1, right?
For a small number of columns I would do it as per my suggestion, testing each column individually.....but if you have a large number of columns there are ways that don't involve splitting them all out, e.g. to average A1:A5 as before but based on data in B1:Z5 try this formula
=AVERAGE(IF(MMULT((B1:Z5=" aa")+0,TRA NSPOSE(COL UMN(B1:Z5) ^0)),A1:A5 ))
confirmed with CTRL+SHIFT+ENTER
regards, barry
=AVERAGE(IF(MMULT((B1:Z5="
confirmed with CTRL+SHIFT+ENTER
regards, barry