data selection query no1.
Ok Data is in Column A and B from Rows 2 to 16 (Headers in Row 1)
ColumnA Column
1 1
2 1
2 1
2 1
2 1
3 1
4 1
5 1
5 1
5 1
5 1
6 2
6 2
6 2
6 2
Column of Numbers from 1 to 6 is in Column D and in Column E we have the formul
ColumnD Column
1 1
2 11.7
3 1
4 1
5 17.
6 20.2
formula is as follow
=IF(COUNTIF($A$2:$A$16,D2)0,SUMIF($A$2:$A$16,D2,$ B$2:$B$16)/COUNTIF($A$2:$A$16,D2),
Which is just copies down that colum
the formula first checks if there is any of that number in the first list (Avoids a Div/O error if one of the numbers was not in the first list) and you can probally leave out this IF if you want to make it as follow
=SUMIF($A$2:$A$16,D2,$B$2:$B$16)/COUNTIF($A$2:$A$16,D2
The sumif adds up the column B if column A is equal to the value in cell D in the above case D2 and the countif counts the number of times in column A the value in cell D occurs
if you write the formulas into excel it should give you more information about what is required for the sumif and countif - both require a range and criteria to match with that range and the sumif also needs to know which column to sum up if it gets a true
|