Finding 2nd Largest Item in a List that meets a Criteria [Excel Array Formulas]
Excel Array Formulas have subtle beauty and raw power. Today I want to share how you can use Excel Array Formulas to find-out the 2nd largest sale amount corresponding to a particular product.
Lets say you have sales data like this:
Now, we all know that, to get 2nd largest sale amount, we can use the LARGE() formula. Like this:
But, how do we know what is the 2nd largest sale amount for the product “bricks”?
Now, that is tricky? Isn’t it?
This is when an array formula can help you.
First the formula:
Type below formula in a cell
and press CTRL+SHIFT+ENTER.
Now, the explanation:
Instead of directly giving the SALES_RANGE to LARGE formula, we are asking excel to include empty spaces “” wherever product <> “Bricks” thru the IF() formula inside LARGE().
Now, when you press CTRL+SHIFT+Enter, excel treats the formula as array formula and processes the lists of values inside nicely.
Download Excel File with Array Formula Examples:
I have put together 4 simple examples to help you understand the power of array formulas. Please download the file from here.
How do you use array formulas?
While array formulas are powerful, they are also difficult to write and explain. I try to solve problems using non-array formula methods as much as possible. But in some cases, like above, I end up writing array formulas.
What about you? Do you use them? How differently would you solve the above problem? Please share using comments.
More examples on array formulas:
- Average of Top 5 Values – Array Formula in Excel
- Sumif with multiple conditions
- Array formula to check if a number is prime
- Using array formulas to find if a list has duplicate items
Do you want to be awesome in Excel?
Here is a smart way to become awesome in Excel. Just signup for my Excel newsletter. Every week you will receive an Excel tip, tutorial, template or example delivered to your inbox. What more, as a joining bonus, I am giving away a 25 page eBook containing 95 Excel tips & tricks. Please sign-up below:
Your email address is safe with us. Our policies
Leave a Reply
|Bad News & VLOOKUP Contest||Insert Currency Symbols & Other Special Characters in Excel [Quick Tip]|