# Sum columns based on two values in Excel 2010

We are trying to SUM three (3) column and calculate its averaged but basing on the "Type" and "Year" that the line pertains to.

Included is an excel with what we are trying to do.

There are 3 columns with values (column Value1, Value2 and Value3).
We want to SUM and COUNT the columns "Value" based on the column "Type" and the column "Year".
Afterward get its average per value based on the year 2014.

In the excel we try to use SUMIF with COUNTA then tried to use SUMIFS, but can't seem to get the result we want.

The attached excel, in the columns N, O and P shows the value that the formula has to calculate (we placed it manually for comparison purposes).
Asked:
###### Who is Participating?

Commented:
I believe this is what you are looking for...

Alternatively you don't have to do with Sumifs/Countifs as in excel 2007 onwards you can apply averageifs formula directly which gives you the same result as shown in the workbook of yours in highlighted cells..

Saurabh...
Summ-trying-read-Type.xlsx
0

Author Commented:
forgot the file.

Summ-trying-read-Type.xlsx
0

Author Commented:
Hey Thankx a lot! It worked!

We did find this function but tried to understand it and just couldn't get it running.  Can you give a brief explaination (using your exact line below):

=AVERAGEIFS(\$H\$14:\$H\$39,\$D\$14:\$D\$39,H\$2,\$E\$14:\$E\$39,\$G6)
0

Commented:
Can I chime in :)

Explanation -

Please calculate the average of the values in H14-39 (target rows), if the following criteria apply:
1. That for the range D14-39, the target rows have value = H2
AND
2. That for the range E14-39, the target rows have a value of G6.
0

Group Finance ManagerCommented:
Why not use a PivotTable?

I am having problems attaching files, but here's a download link for an example with two PivotTables

Average with PivotTables
0

Commented:
rayluvs,

Averagifs.. will work same as sumifs... The parameter for the same are first range is range of which you want to do average..in sumifs its the range you want to do sum of.. Then your other parameters come which your criteria range 1 and criteria 1 ..your crieria range 2 and criteria 2 and so on.. Basically it apply and function between criteria 1 and 2 and all those parameters which matches that condition..it will give an average of it and in case it will give sumif for it..

Hope this helps..

Saurabh...
0

Author Commented:
Thanx!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

## Already a member? Login.

All Courses

From novice to tech pro — start learning today.