Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
997 views
in Technique[技术] by (71.8m points)

excel - Return max index value in vlookup

I'm trying to pair a vlookup with a max function. For some reason it only returns #ref every time I try to use it though.

My sheet looks like this:

      A  -  B  -  C  -  D  -  E  -  F  -  G
1...
5 - Prod5  id1  $100  $125  $155  $110  $150
6...

A:G is named buyAverages C:G is named buyAveragesPrices

What I want to do is have a vlookup go and find a value in Col A and then return the highest value in that Col. So example:

      A  -  B
1 - Prod5 *return highest price for Prod5

What I wrote in B1, which failed:

VLOOKUP(A1,buyAverages,MAX(buyAveragesPrices))

So how do I achieve this lookup? Everything I have found is how to use MAX for the lookup value, but nothing to use max on the returned index.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try this

=MAX(IF(A:A="Prod1",C:G))

This is an Array Formula. i.e you have to press Ctrl+Shift+Enter

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...