Large and index

rpadminserver

Board Regular
Joined
Nov 7, 2007
Messages
111
Office Version
  1. 365
Hello Friends...

I'm using the LARGE command to find the top 5 values in a column with an IF condition. This is working perfect.
=LARGE(IF(A:A="LEVEL 1",D:D,""),1)
(doing ctr-shift-enter for array)

Now, my problem, in column C I have a description that corresponds with the amount found in column D I'm trying to come up with something that will give me the description also

I've tried
=INDEX(C:C,LARGE(IF(A:A="HMOX",D:D,""),1),0)
(again, using array)

I'm pulling a description from C but not the right one.

Help Please.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Try as array (untested)

=INDEX(C:C,MATCH(LARGE(IF(A:A="LEVEL 1",D:D),1),D:D,0))
 
Upvote 0
Hello Friends...

I'm using the LARGE command to find the top 5 values in a column with an IF condition. This is working perfect.
=LARGE(IF(A:A="LEVEL 1",D:D,""),1)
(doing ctr-shift-enter for array)

Now, my problem, in column C I have a description that corresponds with the amount found in column D I'm trying to come up with something that will give me the description also

I've tried
=INDEX(C:C,LARGE(IF(A:A="HMOX",D:D,""),1),0)
(again, using array)

I'm pulling a description from C but not the right one.

Help Please.

That combination is flawed... Try to adapt from post #7 in:

http://www.mrexcel.com/forum/showthread.php?t=342541
 
Upvote 0
@Aladin,

Thanks for this idea...
I read the post you referenced, I wont have any dups. That was taken care of by the SQL that pulls my data.
 
Upvote 0
@Aladin,

Thanks for this idea...
I read the post you referenced, I wont have any dups. That was taken care of by the SQL that pulls my data.

SQL, if well-formed, won't eliminate ties...

A,5
B,2
C,2
D,4
E,5

"Who has the max score" cannot yield any other result than: A and E.
 
Upvote 0
The Values in column D are counts done off of levels and descriptions that are grouped (using group by) in the query

So there will never be more then 1 "Level 1" and "Description 1". The counts are grouped by Level then By descriptions.

---
Actually I see what you are saying....
I'm dealing with high counts so, even though possible, I don't expect to have dup counts. But I'll keep an eye out for it. Thanks



Thanks
 
Last edited:
Upvote 0
The Values in column D are counts done off of levels and descriptions that are grouped (using group by) in the query

So there will never be more then 1 "Level 1" and "Description 1". The counts are grouped by Level then By descriptions.

---
Actually I see what you are saying....
I'm dealing with high counts so, even though possible, I don't expect to have dup counts. But I'll keep an eye out for it. Thanks



Thanks

This is frustrating... I teach my students also relational db's and querying such db's using query grid of Access... Consider the following table:

DEPARMENTS(DID,Description,DHead,Budget)

where DID is the primary key.

The following question:

Which department has the highest budget?

should never be answered with a query that just expects
or designed to expect 1 department having such a budget.
I'd grade such a query definitely with nil.

The same in Excel... Solutions like:

=INDEX(ResultRange,MATCH(MAX(MatchRange),MatchRange,0))

is not admissible.
 
Upvote 0
Thanks for all the help, but I simplified the question I asked, and the scenario to get the answer I needed.

The project I'm working on is not directed toward the top 5 descriptions. The purpose of the report is to compare the percentage of the top 5 against the whole. So if there are any ties between 5-6-7-8, I only need 1 of those to show on the report to complete my objective. That is why equal counts are not an issue.

Thanks again for your help
R
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,543
Members
452,924
Latest member
JackiG

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