How to search for 2nd instance of identical value in a table? (VLOOKUP Issue)

arooney88

Board Regular
Joined
Feb 17, 2014
Messages
61
I have a report that looks up the top 3 errors in a table by %. Rarely are the %'s the same but sometimes they calculate out to be.

Right now I'm using a Vlookup to return my results, but if (for example) there are 2 results that = 50%, both of my return values will be for sentence1 and not for sentence 1 and 2 because the VLOOKUP stops at the first instance of 50%.

I know this is a VLookup issue, but what formula would I be able to use instead? Would this be an INDEX/MATCH instance? I tried using Index/Match in a similiar way and it's giving me the same results.

Thanks for any help everyone!


[TABLE="width: 500"]
<TBODY>[TR]
[TD]50%[/TD]
[TD]Sentence1[/TD]
[/TR]
[TR]
[TD]50%[/TD]
[TD]Sentence2[/TD]
[/TR]
[TR]
[TD]45%[/TD]
[TD]Sentence3[/TD]
[/TR]
</TBODY>[/TABLE]
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
If column A is integers, you could use A1:A100+ROW(A1:A100)/100 to get an array with no duplicates, that preserves the ordering of the values.


But, since you are using two digit percentages, perhaps

=INDEX(B:B, 1000*MOD(LARGE(100*A1:A100+ROW(A1:A100)/10000, 1),1), 1) would return the value corresponding to the highest value in column A.
=INDEX(B:B, 1000*MOD(LARGE(100*A1:A100+ROW(A1:A100)/10000, 2),1), 1) the second highest,
=INDEX(B:B, 1000*MOD(LARGE(100*A1:A100+ROW(A1:A100)/10000, 3),1), 1) the third.
 
Upvote 0
The formula is complicated because the underlying values are probably something like .23, with the cell formatted to show 23%.

The big snag would be if the percentages are calculated exactly with no rounding and the underlying values like .228676666667.

If that is the case, a UDF might be the best approach.

Modifying your underlying data, making it less precise, is a bad idea. Just let us know what you have and a solution that meets your needs can be found without disrespecting the value of accurate data.
 
Upvote 0

Forum statistics

Threads
1,223,101
Messages
6,170,116
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top