1

I have a some data in key-value pairs setup like so:


     A           B
1  Key:        Value:
2  Cars          5
3  Bikes         4
4  Vans          9
5  Trucks        6

What I can't seem to figure out (mind-block) is the formula to answer this:

Product with higest sales:    <answer should be 'Vans'>

What formula would I need to get the result Vans? I've tried this:

 =FILTER(A2:A6, MAX(B2:B6))

To which I get an error stating that the Fliter has mismatched array sizes.

1 Answer 1

2

You need to specify a condition, not just a value, for the FILTER function.

So:

=FILTER(A2:A6, B2:B6 = MAX(B2:B6))

I have set up a demonstration spreadsheet for this, feel free to have a look or copy it.

2
  • Hey, thanks for migrating the question (I'm going to safely assume you did it) and for answering. That worked as expected. +1
    – Abhishek
    Jan 20, 2015 at 1:20
  • Nah, I didn't migrate it, I'm not often at Super User. But Google Spreadsheets questions have a pretty good chance of getting a response here at Web Applications. Jan 20, 2015 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.