AverageIf based on different criteria

1. AverageIf based on different criteria

Hello,

I need a formula that provides the average of salaries based on the following criteria.

Provide the average of salary, if Grade = X and Department =Y and Type = A or B.

Also, is it possible to add the iserror formula so that I dont get the #DIV/0 error for grades that dont have data?

2. Re: AverageIf needed

Looks like you forgot the criteria, but take a look at =AVERAGEIFS(average_range,criteria_range,criteria,...)

3. Re: AverageIf based on different criteria

Thanks Jeff. I submitted before i added my details. I have tried AVERAGEIFS, but it does not seem to return the right data.

4. Re: AverageIf needed

Thanks Jeff. I submitted before i added my details. I have tried AVERAGEIFS, but it does not seem to return the right data.

5. Re: AverageIf based on different criteria

``Please Login or Register  to view this content.``

6. Re: AverageIf based on different criteria

Try this array formula**:

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.

7. Re: AverageIf based on different criteria

Thanks Biff. Built the formula...

AD2:AD187 is the salary average i need to return if the grade = 8, they are in R&D and if their type is either M or AR.

At this time, nothing is populating and i know there should be data there. Any suggestions?

8. Re: AverageIf based on different criteria

A couple of possibilities...

Remove the quotes from around the number 8.

Also, make sure the formula is array entered.

Array formulas are entered differently than a regular formula. After you type in a regular formula you hit the ENTER key. With an array formula you *must* use a combination of keys. Those keys are the CTRL key, the SHIFT key and the ENTER key. That is, hold down both the CTRL key and the SHIFT key then hit the ENTER key.

When done properly Excel will enclose the formula in squiggly brackets { }. You can't just type these brackets in, you *must* use the key combo to produce them. Also, anytime you edit an array formula it *must* be re-entered as an array using the key combo.

9. Re: AverageIf based on different criteria

Thanks for the reply Tony. I removed the "" around the 8, removed the typed {} around "M","AR" and I array entered the formula. I noticed that the {} are placed on the outside of the entire formula (see below) and I dont get an value in the cell. Any other suggestions?

10. Re: AverageIf based on different criteria

Hi caseman,

Tony did not mean for you to remove the {} from inside the formula. Look at his example in post #8.

The {} are for around the formula (ctrl + shift + enter) which makes it an array formula.

http://www.cpearson.com/excel/arrayformulas.aspx

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1