Returning Values in one array based on data from two separate arrays

TenorHobo

New Member
Joined
Nov 24, 2022
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
Hi guys first post here.

So I'm trying to pair people from my organization based on their preferences, and such that if:
Person A preferences Person B, and vice versa, the value 1A is returned.
and if Person A preferences Person C SECOND, and Person C preferences Person A FIRST, the value 2A is returned.

I feel like I'm definitely making things overly complicated for myself, but any help would be appreciated!

Thanks!
First Chart
ABCD
1Biddee1st Pref2nd Pref3rd Pref
2David AikmanNoah BR.Ian G.Soph W.
3Carter WatsonEthan P.William R.Ethan S.
4Emma RichardsonRachael B.Dustin E.Daphne W.
5Cadence HarrelsonAvery A.Ema P.Yesenia M.
MC


Second Chart
ABCD
1Active1st Pref2nd Pref3rd Pref
2Avery A.Cadence HarrelsonEmma RichardsonDavid Aikman
3Daphne W.David AikmanCarter WatsonEmma Richardson
4Dustin E.Carter WatsonDavid AikmanCadence Harrelson
5Ema P.David AikmanEmma RichardsonCarter Watson
6Ethan P.Carter WatsonCadence HarrelsonCarter Watson
7Ethan S.Cadence HarrelsonEmma RichardsonDavid Aikman
8Ian G.Emma RichardsonDavid AikmanCarter Watson
9Noah BR.Carter WatsonEmma RichardsonCadence Harrelson
10Rachael B.Carter WatsonDavid AikmanEmma Richardson
11Soph W.David AikmanCadence HarrelsonCarter Watson
12William R.Emma RichardsonDavid AikmanCarter Watson
13Yesenia M.Cadence HarrelsonCarter WatsonDavid Aikman
Active

Result Chart
EFGHIJKLMNOPQ
14Avery A.Daphne W.Dustin E.Ema P.Ethan P.Ethan S.Ian G.Noah BR.Rachael B.Soph W.William R.Yesenia M.
15David AikmanCABACC2B1B3ABC
16Carter WatsonBAC1A3CAAC2CB
17Emma RichardsonB3C2BBAB1CA
18Cadence Harrelson1AC2BACB3A
Active
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi and welcome to MrExcel!


The "MC" sheet contains the data as you have in your example.
On the "Active" sheet:

Dante Amor
ABCDEFGHIJKLM
1Active1st Pref2nd Pref3rd Pref
2Avery A.Cadence HarrelsonEmma RichardsonDavid Aikman
3Daphne W.David AikmanCarter WatsonEmma Richardson
4Dustin E.Carter WatsonDavid AikmanCadence Harrelson
5Ema P.David AikmanEmma RichardsonCarter Watson
6Ethan P.Carter WatsonCadence HarrelsonCarter Watson
7Ethan S.Cadence HarrelsonEmma RichardsonDavid Aikman
8Ian G.Emma RichardsonDavid AikmanCarter Watson
9Noah BR.Carter WatsonEmma RichardsonCadence Harrelson
10Rachael B.Carter WatsonDavid AikmanEmma Richardson
11Soph W.David AikmanCadence HarrelsonCarter Watson
12William R.Emma RichardsonDavid AikmanCarter Watson
13Yesenia M.Cadence HarrelsonCarter WatsonDavid Aikman
14
15Avery A.Daphne W.Dustin E.Ema P.Ethan P.Ethan S.Ian G.Noah BR.Rachael B.Soph W.William R.Yesenia M.
16David AikmanCABA C2B1B3ABC
17Carter Watson BAC1A3CAAC2CB
18Emma RichardsonB3C2B BAB1C A 
19Cadence Harrelson1A C2BA C B 3A
Active
Cell Formulas
RangeFormula
B16:M19B16=IFERROR(MATCH(B$15,INDEX(MC!$B$2:$D$5,MATCH($A16,MC!$A$2:$A$5,0),0),0),"")& IFERROR(CHOOSE(MATCH($A16,INDEX($B$2:$D$13,MATCH(B$15,$A$2:$A$13,0),0),0),"A","B","C"),"")
 
Upvote 0
Another option
Fluff.xlsm
ABCDEFGHIJKLMNOPQR
1Active1st Pref2nd Pref3rd PrefAvery A.Daphne W.Dustin E.Ema P.Ethan P.Ethan S.Ian G.Noah BR.Rachael B.Soph W.William R.Yesenia M.
2Avery A.Cadence HarrelsonEmma RichardsonDavid AikmanDavid AikmanCABAC2B1B3ABC
3Daphne W.David AikmanCarter WatsonEmma RichardsonCarter WatsonBAC1A3CAAC2CB
4Dustin E.Carter WatsonDavid AikmanCadence HarrelsonEmma RichardsonB3C2BBAB1CA
5Ema P.David AikmanEmma RichardsonCarter WatsonCadence Harrelson1AC2BACB3A
6Ethan P.Carter WatsonCadence HarrelsonCarter Watson
7Ethan S.Cadence HarrelsonEmma RichardsonDavid Aikman
8Ian G.Emma RichardsonDavid AikmanCarter Watson
9Noah BR.Carter WatsonEmma RichardsonCadence Harrelson
10Rachael B.Carter WatsonDavid AikmanEmma Richardson
11Soph W.David AikmanCadence HarrelsonCarter Watson
12William R.Emma RichardsonDavid AikmanCarter Watson
13Yesenia M.Cadence HarrelsonCarter WatsonDavid Aikman
14
15
16
Sheet2
Cell Formulas
RangeFormula
G2:R5G2=MAKEARRAY(4,12,LAMBDA(r,c,IFNA(MATCH(INDEX(G1:R1,,c),FILTER(MC!B2:D5,MC!A2:A5=INDEX(F2:F5,r)),0),"")&IFNA(CHAR(MATCH(INDEX(F2:F5,r),FILTER(B2:D20,A2:A20=INDEX(G1:R1,c)),0)+64),"")))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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