Fwd: Excel TRIMMEAN can be AVERAGE IF you do it Right

633 views
Skip to first unread message

Kuldeep Singh

unread,
Oct 2, 2013, 4:24:31 AM10/2/13
to excelvb...@googlegroups.com, excel-v...@googlegroups.com


---------- Forwarded message ----------
From: My Online Training Hub <web...@myonlinetraininghub.com>
Date: Wed, Oct 2, 2013 at 7:45 AM
Subject: Excel TRIMMEAN can be AVERAGE IF you do it Right
To: Kuldeep <naukri...@gmail.com>


Maybe this should be a new function in the next release of Excel...what do you think?
View this tutorial in your browser.

TRIMMEAN is no AVERAGEIF unless you know how

I stumbled upon an interesting question the other day, which was; ‘how do I find the average of a range of numbers that meet criteria, and by the way, I want to exclude the outliers?’

Now, if all we needed was a simple average that met criteria we could use an AVERAGEIF or AVERAGEIFS formula.

Or if we just wanted to exclude the outliers we could use the TRIMMEAN function which returns the mean (average) of the interior proportion of values.

The syntax is:

TRIMMEAN(array, percent)

Where the array is the range containing your values and percent is the fractional number of data points you want to exclude from the top and bottom of your data set.

But we want to effectively find the AVERAGEIF and TRIMMEAN.

Unfortunately this pair don’t get on so well in the same cell so I’ve got an alternative and it’s not called TRIMMEANIF….but maybe there’s an idea.

Note to self; write to Microsoft suggesting new TRIMMEANIF function!

Ok, let’s take this list as our example:

Excel Average IF excluding top and bottom values

And let’s say we want to find the average Units for Size 8 and exclude the top and bottom 40%.

Note: you wouldn’t normally exclude 40% of your sample but since mine is so small (so it’ll easily fit on the screen) I have had to make the proportion to exclude quite large.

Here’s the formula:

=TRIMMEAN(IF(B2:B12=8,C2:C12),40%)

It’s an array formula so you need to enter it with CTRL+SHIFT+ENTER.

In English it reads: Find the MEAN (average) of the values in the range C2:C12, where the size in the range B2:B12 is 8, oh, and by the way, ignore the top and bottom 40% of the values.

My nested IF formula returns an array of Units that are size 8, and if we step through how the formula evaluates we can see it looks like this:

Step 1:

Evaluate the IF formula logical test and expand the range C2:C12:

=TRIMMEAN(IF({TRUE;TRUE;TRUE;TRUE;TRUE;FALSE;FALSE; FALSE;FALSE;FALSE;FALSE}, {2;4;5;6;9;4;10;8;9;4;1}), 40%)

Step 2:

Create an array of the values that evaluate to TRUE:

=TRIMMEAN({2;4;5;6;9}, 40%)

Step 3:


Strip out the outliers from the array of values:

=TRIMMEAN({4;5;6})

Step 4:

Find the mean (average) of the remaining values:

=5

Note: if you run this formula through the Evaluate Formula tool you will see it work through the steps above.

Spread the Word

If you liked this or know someone who could use it please click the buttons below to share it with your friends on LinkedIn, Google+1, Facebook and Twitter.

And if you want to help start a movement to get Microsoft to include a new TRIMMEANIF function in the next release of Excel click on all of them! Heck, why not click on all of them anyway and have a clickety click day :-)

Have a great day,

Mynda
Co-founder & Head Excel Geek
My Online Training Hub

Too Advanced?


If this is too advanced a great starting point is our Excel Formulas List of tutorials.

Merge Excel Worksheets


If I had a dollar for every time someone asked me how to do this....ugh, let's not go there.

If you need to merge or consolidate worksheets the built in tools like 'Consolidate' and PivotTables with multiple consolidation tables are less than desirable.

This is when VBA must become your 'go-to' guy.

How to merge Excel Worksheets with VBA.

More from the Average Family

Another member of the Average family that you might find useful is the AVERAGE LARGE formula which finds the average of the top 3 values.

Can't Get Enough Excel


Browse the blog for more gems like these.

And if you want to search for something specific use the 'Search' box in the top right of the website.

Help us get to our next milestone


We are 1, just one, Facebook like away from reaching 500 likes.

Please help us exceed that milestone and more by clicking here to like our Facebook page.

We'll love you forever!

Copyright © 2013 My Online Training Hub, All rights reserved.
You are receiving this email because you either purchased one of our products, signed up for our free training or opted in to receive our newsletter.

Our mailing address is:
My Online Training Hub
PO Box 7206
Sippy Downs, Queensland 4556
Australia

Add us to your address book


unsubscribe from this list    update subscription preferences 




--
Regards,
Kuldeep Singh
Assistant Manager Quality
Game Zone India Limited
Phone.: +91-8586978644
|| naukri...@gmail.com ||
Please Consider the environment. Please don't print this e-mail unless you really need to.
Reply all
Reply to author
Forward
0 new messages