Index, Match,or List??

spm0r1n

New Member
Joined
Mar 28, 2017
Messages
11
I have an spreadsheet with 40+ columns that are support hubs, and 1400+ rows of support sites. I have distance data for all contained in a matrix format.

I want to be able to use a drop down menu to select one of the support hubs, and then have list/match to select all entries within the hubs column that match certain criteria, i.e <= 80, =>200

once the matches are found, I need the row headers( Supported Sites) to be copied to another worksheet in either row or column.

Will a variation of the following work? Both of theses are working fine.
This formula looks through the distance of the sites and matches the smallest next smallest,etc, and populates the column header.

<colgroup><col span="6" width="84"></colgroup><tbody>
[TD="class: xl64, width: 84"]=INDEX($X$1:$BM$1,MATCH(SMALL($X18:$BM18,1),$X18:$BM18,0))
[/TD]

</tbody>
=INDEX($X$1:$BM$1,MATCH(SMALL($X13:$BM13,2),$X13:$BM13,0))
=INDEX($X$1:$BM$1,MATCH(SMALL($X13:$BM13,3),$X13:$BM13,0))

This formula just populates the actual mileage
=SMALL($X13:$BM13,1)
=SMALL($X13:$BM13,2)
=SMALL($X13:$BM13,2)


Thanks.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi, maybe you can see if you can adapt this to your set-up.


Excel 2013/2016
ABCDEFGHIJKLM
1Hubs>
2SiteH1H2H3H4H5H6H7H8H9Drop DownH3
3S11698955865169347>= Criteria80
4S23156323198916631<= Criteria200
5S385688821751997415150Helper3
6S41873468010020354948ResultsS1
7S5259877339810952737S3
8S65441791838716603S7
9S7466981262121549362
10S816982366467894410
Sheet1
Cell Formulas
RangeFormula
M5=COUNTIFS(INDEX($B$3:$J$10,0,MATCH($M$2,$B$2:$J$2,0)),">="&M3,INDEX($B$3:$J$10,0,MATCH($M$2,$B$2:$J$2,0)),"<="&M4)
M6{=IF(ROWS(M$6:M6)>$M$5,"",INDEX($A$3:$A$10,SMALL(IF(INDEX($B$3:$J$10,0,MATCH($M$2,$B$2:$J$2,0))>=$M$3,IF(INDEX($B$3:$J$10,0,MATCH($M$2,$B$2:$J$2,0))<=$M$4,ROW($A$3:$A$10)-ROW($A$3)+1)),ROWS(M$6:M6))))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
FormR, thanks for response. Ithought I had relied yesterday, but I do not see them.

The first part of the response works well and the results changes as I change the values for the range. Here is what I have as a formula;
=COUNTIFS(INDEX(sites!$R$2:$BF$1445,0,MATCH($B$3,sites!$R$1:$BF$1,0)),">="&C3,INDEX(sites!$R$2:$BF$1445,0,MATCH($B$3,sites!$R$1:$BF$1,0)),"<="&D3)

the second part however is not working. I am entering the formula correctly as I do get the {} brackets. I keep getting #N/A?
This is the formula I am using
=IF(ROWS(F$4:F4)>$F$3,"",INDEX(sites!A2:A1445,SMALL(IF(INDEX(sites!$R$2:$BF$2,0,MATCH($B$3,sites!$R$2:$BF$2,0))>=$C$3,IF(INDEX(sites!$R$2:$BF$1445,0,MATCH($B$3,sites!$R$2:$BF$2,0))<=$D$3,ROW(sites!$A$2:$A$1446)-ROW(sites!$A$2)+1)),ROWS(F$4:F4))))
Here are the actual cells I am using mapped to yours in the example
M2 =B3
M3=C3
M4=D3
M5=F3
M6=F4

Thanks
 
Upvote 0
This is the formula I am using

Hi, give this a try, you were quite close - I'll let you see if you can spot the differences (assuming it works) :)

Code:
=IF(ROWS(F$4:F4)>$F$3,"",INDEX(Sites!$A$2:$A$1445,SMALL(IF(INDEX(Sites!$R$1:$BF$1445,0,MATCH($B$3,Sites!$R$1:$BF$1,0))>=$C$3,IF(INDEX(Sites!$R$2:$BF$1445,0,MATCH($B$3,Sites!$R$1:$BF$1,0))<=$D$3,ROW(Sites!$A$2:$A$1446)-ROW(Sites!$A$2)+1)),ROWS(F$4:F4))))
 
Upvote 0
So I am now getting " A value is not available to the formula or function.

I assume I need to make sure all fields in the Sites worksheet have a valid numerical /text reference?

I did catch the errors though, thanks again
 
Upvote 0
Error is on the cell I am entering formula, F4. Using excel 2016 all contained in same spreadsheet. Testing formulas on separate worksheet.
 
Upvote 0
It seems to be working but as you can see there are 32 sites for the range selected, but only one site shows up?
HubRange StartStarting
12110
TDC0190

<colgroup><col style="width:48pt" span="2" width="64"> <col style="mso-width-source:userset;mso-width-alt:4754;width:98pt" width="130"> <col style="width:48pt" span="4" width="64"> </colgroup><tbody>
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 130"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]

[TD="colspan: 2"]RangeEnd[/TD]

[TD="align: right"]0[/TD]
[TD="align: right"]80[/TD]

[TD="align: right"]32[/TD]

</tbody>
 
Upvote 0
Man, I tell you. Some times it is the simplest things that get you. I had not copied the formula downward. DOH!!

Thanks again for the assistance.
 
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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