Displaying Multiple Matches in Complex Matrix

CodyWoodman

New Member
Joined
Nov 24, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I apologize if this question has been answered before, but I honestly have no idea what to search for.

I have a matrix, where all the rows in column A are our customers' names. In row 1, I have a duplicate of all of our customers' names (the Matrix runs from A1:FF149). Each of the cells in the table has the distance between each customer in KM.

Essentially my goal is when a Customer's name is inputted, Excel will display other customers within a certain distance (say 200km).

I have posted a photo with a much smaller scale of what I'm trying to accomplish to give you an idea.
 

Attachments

  • Screenshot 2022-11-24 154657.png
    Screenshot 2022-11-24 154657.png
    18.8 KB · Views: 10

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi Cody

Change you data from crosstabular format into list format.

Mappe7
JKL
2AB167
3AC322
4AD100
5AE121
6BC443
7BD271
8BE243
9CD242
10CE130
11DE362
12
13B
14
15A167
16E243
17D271
Tabelle1
Cell Formulas
RangeFormula
J15:K17J15=SORT(TEXTSPLIT(TEXTJOIN({":";"|"},TRUE,FILTER(SUBSTITUTE(J2:L11,J13,""),((J2:J11=J13)+(K2:K11=J13))*(L2:L11<300))),":","|"),2)
Dynamic array formulas.


I used 5 functions. I wonder if less is possible.
 
Upvote 0
The original setup requires 7 functions.
Mappe7
ABCDEF
1ABCDE
2A167322100121
3B167443271243
4C322443242130
5D100271242362
6E121243130362
7
8
9B
10
11A167
12E243
13D271
Tabelle1
Cell Formulas
RangeFormula
B11:C13B11=LET( a,HSTACK(A2:A6,INDEX(B2:F6,0,MATCH(B9,$B$1:$F$1,0))), b,INDEX(a,,2), c,FILTER(a,(b>0)*(b<300)), SORT(c,2))
Dynamic array formulas.
 
Upvote 0
Solution
Welcome to the MrExcel board!

A slightly different version that you could also consider.

CodyWoodman.xlsm
ABCDEFG
1ABCDE
2A167322100121
3B167443171143
4C322443242130
5D100171242362
6E121143130362
7
8
9B
10
11E143
12A167
13D171
14
Sheet1
Cell Formulas
RangeFormula
B11:C13B11=LET(f,FILTER(A2:F6,(A1:F1=B9)+(A1:F1="")),d,INDEX(f,,2),SORT(FILTER(f,(d<200)*(d>0),{"",""}),2))
Dynamic array formulas.
 
Upvote 0
The original setup requires 7 functions.
Mappe7
ABCDEF
1ABCDE
2A167322100121
3B167443271243
4C322443242130
5D100271242362
6E121243130362
7
8
9B
10
11A167
12E243
13D271
Tabelle1
Cell Formulas
RangeFormula
B11:C13B11=LET( a,HSTACK(A2:A6,INDEX(B2:F6,0,MATCH(B9,$B$1:$F$1,0))), b,INDEX(a,,2), c,FILTER(a,(b>0)*(b<300)), SORT(c,2))
Dynamic array formulas.

This worked for me perfectly!!! Thank you!!
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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