Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Excel look up value

0

Hello,

When I for example use the Large function, I would like to go to the value that comes out of the formule.

Lets say I have a excel sheel full of numbers and I would like to go to the 30th highest value. I could do a search and find that particular value, however, there are more values that are the same. Therefore I would like to know the exact value that is given by the formula.

Is there a way to do this?

Thanks! 

Lex

Answer
Discuss

Discussion

Hi Lex and welcome to the Forum.

I'm not clear what you're trying to do here. The 30th largest value is returned by 
=LARGE(A1:G650,30)
if you change A1:G650 to your sheet/range (but the 29th, 31st and 32nd might also be the same value if there are duplicates.

Are you looking for the address of that cell? Do you perhaps need INDEX/MATCH to locate someone or something linked to the nth highest value?

Please edit your original Question to clarify what you're trying to do (and perhaps use Add Files button to attach a sample Excel spreadsheet)

John_Ru (rep: 6142) Feb 16, '21 at 7:43 am
Add to Discussion

Answers

0
Selected Answer

The formula below will give you the address of the cell where the 2nd largest value was found in the list A1:A10. Of course, you know how to modify this to return the position of the 30th-largest.

=ADDRESS(MATCH(LARGE(A1:A10,2),A1:A10,0),1,4,1)

This formula uses LARGE(A1:A10,2) as the look-up value for a MATCH function which returns the row number which is used to specify the cell in column 1 (which is column A). The remaining two code numbers, 4 and 1 specify the format of the address. 4 suppresses the $ signs, making the address relative and the final 1 specifies the output format as A1-type.

Note that it's important to start the look-up range in row 1. If your range can't be specified in this way you need to compensate for a different start because MATCH will return its result relative to the look-up range, meaning if the match was found in the 3rd row of the range the sheet row will be different, depending upon which roiw the range starts on.

I'm not sure that this is what you requested, siince "I would like to know the exact value that is given by the formula" is ambiguous. The LARGE function does give you the exact value. But with the help of the above formula you will know where the value was found.

Discuss
0

Lex

You imply that your numbers are in several rows and columns (rather than in a single coulmn, as addressed neatly in the answer from Variatus). In that case, you can use the LARGE function in conjunction with an array formula to locate the nth value.

In the attached sheet there's a 3x10 array (shaded in light gold) which I've defined as ValueArray using the Name Manager. In the box F3:G7, you just have to enter n in the yellow cell G3 (where n is between 1 and the maximum number of cells in the arrray, 30 in this case).

G4 is a regular formula which returns the nth highest value, taking n from G3:

=LARGE(ValueArray,G3)

G4 is an array value to return the Row where that nth value in G4 is first found in the array:

{=MIN(IF(ValueArray=G$4,ROW(ValueArray)))}
and has to be confirmed with Ctrl+Shift+Enter.

G5 is a similar array formula but locates the first column. G7 then uses a regular formula to return the A1 format address of the cell (from the row in G4, column in G5):

=ADDRESS(G5,G6,4,1)
 You can call the array what you like and change the size but be careful when entering the array formulae. You could combine G7,G6 and G5 into a single array formula if you like!

Hope this is what you're looking for.

Discuss

Discussion

Amazing thanks! 
LexBoot (rep: 2) Feb 22, '21 at 9:39 am
Glad it worked, Lex. thanks for selecting my Answer.
John_Ru (rep: 6142) Feb 22, '21 at 9:51 am
Oops. Hadn't realised that you had already selected (and presumably preferred/ used) the other Answer for Variatus. Oh well.
John_Ru (rep: 6142) Feb 22, '21 at 10:41 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login