INDEX MATCH LARGE IF? Help please

tjw23

New Member
Joined
Nov 19, 2014
Messages
6
Hello

I am trying to work out a formula which will return a name in relation to a highest result in a column from a range of columns which will have data added to each week.

Having used this website before (thanks for the help) I have used the following formula which gives me the name in relation to the highest figure in one column:

=INDEX($A$8:$A$140,MATCH(LARGE(F$8:$F$140-ROW($F$8:$F$140)/10^5,1),$F$8:$F$140-ROW($F$8:$F$140)/10^5,0))

Column A being the list of names, column F being the column in which the numerical values are. The above also avoids issues with names who each have the same value relating to them. I have a top 10 list so it shows the top 10 names who have the highest values.

I now want to do the same thing but where the names in column A are coming from a range of data which is added to once a week. For instance say information is added each week in a year, I have 52 columns set up for data to be entered into. I want the largest (top 10 list) of names to be generated from the values entered into the most recent week. So in week 1 the names come from the data entered into week 1, then when week 2’s data is entered, the list of names automatically changes to pick up the top 10 from week 2 etc.

I have got a (probably not the best) formula using lots of “IFs” to automatically update the top 10 values, but I cannot figure out a formula to return the names relating to those values.

=IF(Z141>0,LARGE(Z8:Z140,1),IF(Y141>0,LARGE(Y8:Y140,1),IF….

I have tried incorporating the long IF formula into the INDEX MATCH LARGE formula above but I am not having any luck at the moment.

Any ideas would be much appreciated.

Thanks
tjw23
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi

Welcome to the MrExcel forum.

If you changed your IF statement to :-
Code:
=LARGE(INDEX((X8:X140,Y8:Y140,Z8:Z140),,,MATCH(0,X141:Z141,-1)),1)

such that only one of X141:Z141 contained 1 and the rest contained 0 to activate the relevant column, would that help?
 
Upvote 0
Thanks for the reply Mike.
i have tried your suggestion but it doesn't appear to be working (at least the way I have tried it).
Thank you though
 
Upvote 0
I have managed to get the following formula to give the correct names in order (top 10) with their relevant values for one week:
{=INDEX(A8:A140,MATCH(IF(F141>0,LARGE(F8:F140,1),0),F8:F140,0))}
Where F141 is the sum of the values in the range F8:F140

I just can't seem to get this to work when I extend it across the range of columns with more "Ifs". I am also not sure that would help me the names which have the same values (keep returning the same name).
 
Upvote 0
Hi

There was a slight problem with the suggestion that the non-relevant cells should contain zero, they should be empty.

Here are two examples :-
Excel Workbook
ABCDEFG
19John
20
21Fred7393
22Bill227
23Jim933
24Bert1579
25John200200
26Martin4041
27Dave7566
28Harry131153
29Joe2992
30670
tjw23
Excel 2007
Cell Formulas
RangeFormula
G19=INDEX(A21:A29,MATCH(LARGE(INDEX((F21:F29,G21:G29),,,MATCH(0,F30:G30,-1)),1),INDEX((F21:F29,G21:G29),,,MATCH(0,F30:G30,-1)),0))
F30=SUM(F21:F29)
Excel Workbook
ABCDEFG
19Fred
20
21Fred7393
22Bill227
23Jim933
24Bert1579
25John200200
26Martin4041
27Dave7566
28Harry131153
29Joe2992
30994
tjw23
Excel 2007
Cell Formulas
RangeFormula
G19=INDEX(A21:A29,MATCH(LARGE(INDEX((F21:F29,G21:G29),,,MATCH(0,F30:G30,-1)),1),INDEX((F21:F29,G21:G29),,,MATCH(0,F30:G30,-1)),0))
G30=SUM(G21:G29)


hth
 
Upvote 0
I thought this had worked but it doesn't seem to have done. It works perfectly when just two weeks are considered, but doesn't seem to when I apply the formula to more than two weeks. Perhaps I am going about it incorrectly though!? I don't think the fact that I have empty columns in between those that have data in (so F, H, J rather than F, G, H) is making a difference either as it seems to work fine when I just use two week's work of data.

This is what I have for 3 weeks, I eventually need 38 weeks:
{=INDEX(A8:A140,MATCH(LARGE(INDEX((F8:F140,H8:H140,J8:J140),,,MATCH(0,F141:J141,-1)),1),INDEX((F8:F140,H8:H140,J8:J140),,,MATCH(0,F141:J141,-1)),0))}

Any help would be much appreciated.

Thanks
 
Upvote 0
Hi

The intervening columns were causing the problem, however :-
tjw23[TABLE="class: html-maker-worksheet"]
<thead>[TR]
[TH][/TH]
[TH]A[/TH]
[TH]B[/TH]
[TH]C[/TH]
[TH]D[/TH]
[TH]E[/TH]
[TH]F[/TH]
[TH]G[/TH]
[TH]H[/TH]
[TH]I[/TH]
[TH]J[/TH]
[/TR]
</thead><tbody>[TR]
[TH]21[/TH]
[TD]Fred[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]7[/TD]
[TD][/TD]
[TD="align: right"]393[/TD]
[TD][/TD]
[TD="align: right"]66[/TD]
[/TR]
[TR]
[TH]22[/TH]
[TD]Bill[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]22[/TD]
[TD][/TD]
[TD="align: right"]7[/TD]
[TD][/TD]
[TD="align: right"]153[/TD]
[/TR]
[TR]
[TH]23[/TH]
[TD]Jim[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD="align: right"]33[/TD]
[TD][/TD]
[TD="align: right"]92[/TD]
[/TR]
[TR]
[TH]24[/TH]
[TD]Bert[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]157[/TD]
[TD][/TD]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TH]25[/TH]
[TD]John[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]200[/TD]
[TD][/TD]
[TD="align: right"]200[/TD]
[TD][/TD]
[TD="align: right"]157[/TD]
[/TR]
[TR]
[TH]26[/TH]
[TD]Martin[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]40[/TD]
[TD][/TD]
[TD="align: right"]41[/TD]
[TD][/TD]
[TD="align: right"]200[/TD]
[/TR]
[TR]
[TH]27[/TH]
[TD]Dave[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]75[/TD]
[TD][/TD]
[TD="align: right"]66[/TD]
[TD][/TD]
[TD="align: right"]40[/TD]
[/TR]
[TR]
[TH]28[/TH]
[TD]Harry[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]131[/TD]
[TD][/TD]
[TD="align: right"]153[/TD]
[TD][/TD]
[TD="align: right"]75[/TD]
[/TR]
[TR]
[TH]29[/TH]
[TD]Joe[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]29[/TD]
[TD][/TD]
[TD="align: right"]92[/TD]
[TD][/TD]
[TD="align: right"]131[/TD]
[/TR]
[TR]
[TH]30[/TH]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]923[/TD]
[/TR]
[TR]
[TH]31[/TH]
[TD]Martin[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Excel 2007

CellFormula
J30=SUM(J21:J29)
A31=INDEX(A21:A29,MATCH(LARGE(INDEX(F21:J29,,MATCH(0,F30:J30,-1)),ROWS($A$31:$A31)),INDEX(F21:J29,,MATCH(0,F30:J30,-1)),0))

<tbody>
[TD="bgcolor: #FFFFFF"] Worksheet Formulas [TABLE="class: html-maker-worksheet"]
<thead>[TR]

</thead><tbody>
</tbody>
[/TD]
[/TR]
</tbody>[/TABLE]

This change to the formula caters for that situation.

Remember that on the trigger row (row 30 above) the column on which you wish to operate is the ONLY one that has a value.

Also, if you wish the other names to appear then the data ranges have to have absolute references and the formula can then be dragged down.

hth
 
Last edited:
Upvote 0
Thank you very much. That works well but I have a problem with duplicate values now. It keeps returning the same name if the value is the same.
 
Upvote 0
Hi

I have managed to workaround this by adding a helper column :-
Excel Workbook
AFGHIJKLM
21Fred7393666
22Bill2271533
23Jim933925
24Bert157999
25John2002001572
26Martin40412001
27Dave7566407
28Harry131153408
29Joe29921314
30888
31Martin
32John
33Bill
34Joe
35Jim
36Fred
37Dave
38Harry
39Bert
tjw23
Excel 2007
Cell Formulas
RangeFormula
A31=INDEX($A$21:$A$29,MATCH(SMALL($M$21:$M$29,ROWS($A$31:$A31)),$M$21:$M$29,0))
M21=RANK(INDEX($F21:$J21,,MATCH(0,$F$30:$J$30,-1)),INDEX($F$21:$J$29,,MATCH(0,$F$30:$J$30,-1)),0)+COUNTIF(INDEX($F$21:$J21,,MATCH(0,$F$30:$J$30,-1)),INDEX($F21:$J21,,MATCH(0,$F$30:$J$30,-1)))-1
J30=SUM(J21:J29)


Column M is the helper column and the formula can be dragged down.

Applying the helper column somewhat simplifies the name extraction formula in A31.

hth
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,987
Members
452,373
Latest member
TimReeks

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