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: =LARGE(RANGE,2)
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
=LARGE(IF(PRODUCTS_RANGE="Bricks",SALES_RANGE,""),2)
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.
















4 Responses to “How windy is Wellington? – Using Power Query to gather wind data from web”
Breaking - Wind jokes at Chandoo
Kiwis sniffing for clues about blog post reason
It's confirmed: Wellington is windier than Uranus.
Acompanhando e aguardando ansiosamente a segunda parte.
[]s.
[Google translate]: Accompanying and eagerly awaiting the second part
hi chandoo,
i've tried using power query, however i face a rather weird problem. when i click on 'from web' option, the URL window does not show option for basic and advanced. thus i'm unable to form parameters in URL. how i can resolve this issue?