Find 2nd Value in a Row, Return Adjacent Cell

MeditateMan

New Member
Joined
Sep 15, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello, been reading up on the forms and trying different solutions but I am stumped.

I have a row with an NFL Position, and to the right of it the NFL Player's Name. However there are multiple instances of RB and WR.

I need assistance in filling in columns V,X,Y with the 2nd Instance of RB (V), 2nd Instance of WR (X), 3rd Instance of WR (Y) from the same row.

Book2.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
1QBRBRBWRWRWRTEFlexDST
2QBMatt RyanRBNajee HarrisRBSaquon BarkleyFLEXJustin JeffersonWRBrandin CooksWRMichael PittmanWRJahan DotsonTETravis KelceDSTSteelersMatt RyanNajee HarrisBrandin CooksTravis KelceJustin JeffersonSteelers
3QBJameis WinstonRBD'Andre SwiftFLEXSaquon BarkleyRBDameon PierceWRJustin JeffersonWRMichael PittmanWRChristian KirkTETravis KelceDSTLionsJameis WinstonD'Andre SwiftJustin JeffersonTravis KelceSaquon BarkleyLions
4QBTrevor LawrenceRBChristian McCaffreyRBSaquon BarkleyFLEXJustin JeffersonWRChristian KirkWRMarvin JonesWRJahan DotsonTETravis KelceDSTSteelersTrevor LawrenceChristian McCaffreyChristian KirkTravis KelceJustin JeffersonSteelers
5QBJalen HurtsRBChristian McCaffreyRBSaquon BarkleyWRA.J. BrownWRMichael PittmanWRJahan DotsonFLEXTravis KelceTEDallas GoedertDSTVikingsJalen HurtsChristian McCaffreyA.J. BrownDallas GoedertTravis KelceVikings
6QBCarson WentzRBChristian McCaffreyRBSaquon BarkleyWRTerry McLaurinWRMichael PittmanWRChristian KirkFLEXJahan DotsonTETravis KelceDSTFalconsCarson WentzChristian McCaffreyTerry McLaurinTravis KelceJahan DotsonFalcons
7QBPatrick MahomesRBNick ChubbRBSaquon BarkleyWRDJ MooreWRJuJu Smith-SchusterWRChristian KirkTETravis KelceFLEXZach ErtzDSTSteelersPatrick MahomesNick ChubbDJ MooreTravis KelceZach ErtzSteelers
8QBMarcus MariotaRBJonathan TaylorRBSaquon BarkleyWRMichael PittmanWRDrake LondonWRJakobi MeyersFLEXTravis KelceTEKyle PittsDSTSteelersMarcus MariotaJonathan TaylorMichael PittmanKyle PittsTravis KelceSteelers
9QBPatrick MahomesRBJonathan TaylorRBSaquon BarkleyFLEXMarquise BrownWRJuJu Smith-SchusterWRJahan DotsonWRWan'Dale RobinsonTETravis KelceDSTDolphinsPatrick MahomesJonathan TaylorJuJu Smith-SchusterTravis KelceMarquise BrownDolphins
10QBKirk CousinsRBAaron JonesRBSaquon BarkleyWRDavante AdamsWRJustin JeffersonFLEXAdam ThielenWRJahan DotsonTEGerald EverettDSTDolphinsKirk CousinsAaron JonesDavante AdamsGerald EverettAdam ThielenDolphins
11QBJalen HurtsRBJoe MixonRBAaron JonesFLEXSaquon BarkleyWRJustin JeffersonWRParris CampbellWRRomeo DoubsTETravis KelceDSTDolphinsJalen HurtsJoe MixonJustin JeffersonTravis KelceSaquon BarkleyDolphins
12QBPatrick MahomesRBJoe MixonRBSaquon BarkleyFLEXMarquise BrownWRMichael PittmanWRJuJu Smith-SchusterWRRandall CobbTETravis KelceDSTVikingsPatrick MahomesJoe MixonMichael PittmanTravis KelceMarquise BrownVikings
13QBKirk CousinsRBAaron JonesRBSaquon BarkleyFLEXJustin JeffersonWRMichael PittmanWRAdam ThielenWRJahan DotsonTETravis KelceDSTGiantsKirk CousinsAaron JonesMichael PittmanTravis KelceJustin JeffersonGiants
Sheet1
Cell Formulas
RangeFormula
T2:T13T2=B2
U2:U13U2=INDEX(A2:Q2,MATCH("RB",A2:R2,0)+1)
Z2:Z13Z2=INDEX(A2:Q2,MATCH("TE",A2:R2,0)+1)
AA2:AA13AA2=INDEX(A2:Q2,MATCH("FLEX",A2:R2,0)+1)
AB2:AB13AB2=R2
W2:W13W2=INDEX(A2:Q2,MATCH("wr",A2:R2,0)+1)
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
MrExcelPlayground11.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
2QBMatt RyanRBNajee HarrisRBSaquon BarkleyFLEXJustin JeffersonWRBrandin CooksWRMichael PittmanWRJahan DotsonTETravis KelceDSTSteelersMatt RyanNajee HarrisSaquon BarkleyBrandin CooksMichael PittmanJahan DotsonTravis KelceJustin JeffersonSteelers
3QBJameis WinstonRBD'Andre SwiftFLEXSaquon BarkleyRBDameon PierceWRJustin JeffersonWRMichael PittmanWRChristian KirkTETravis KelceDSTLionsJameis WinstonD'Andre SwiftDameon PierceJustin JeffersonMichael PittmanChristian KirkTravis KelceSaquon BarkleyLions
4QBTrevor LawrenceRBChristian McCaffreyRBSaquon BarkleyFLEXJustin JeffersonWRChristian KirkWRMarvin JonesWRJahan DotsonTETravis KelceDSTSteelersTrevor LawrenceChristian McCaffreySaquon BarkleyChristian KirkMarvin JonesJahan DotsonTravis KelceJustin JeffersonSteelers
5QBJalen HurtsRBChristian McCaffreyRBSaquon BarkleyWRA.J. BrownWRMichael PittmanWRJahan DotsonFLEXTravis KelceTEDallas GoedertDSTVikingsJalen HurtsChristian McCaffreySaquon BarkleyA.J. BrownMichael PittmanJahan DotsonDallas GoedertTravis KelceVikings
6QBCarson WentzRBChristian McCaffreyRBSaquon BarkleyWRTerry McLaurinWRMichael PittmanWRChristian KirkFLEXJahan DotsonTETravis KelceDSTFalconsCarson WentzChristian McCaffreySaquon BarkleyTerry McLaurinMichael PittmanChristian KirkTravis KelceJahan DotsonFalcons
7QBPatrick MahomesRBNick ChubbRBSaquon BarkleyWRDJ MooreWRJuJu Smith-SchusterWRChristian KirkTETravis KelceFLEXZach ErtzDSTSteelersPatrick MahomesNick ChubbSaquon BarkleyDJ MooreJuJu Smith-SchusterChristian KirkTravis KelceZach ErtzSteelers
8QBMarcus MariotaRBJonathan TaylorRBSaquon BarkleyWRMichael PittmanWRDrake LondonWRJakobi MeyersFLEXTravis KelceTEKyle PittsDSTSteelersMarcus MariotaJonathan TaylorSaquon BarkleyMichael PittmanDrake LondonJakobi MeyersKyle PittsTravis KelceSteelers
9QBPatrick MahomesRBJonathan TaylorRBSaquon BarkleyFLEXMarquise BrownWRJuJu Smith-SchusterWRJahan DotsonWRWan'Dale RobinsonTETravis KelceDSTDolphinsPatrick MahomesJonathan TaylorSaquon BarkleyJuJu Smith-SchusterJahan DotsonWan'Dale RobinsonTravis KelceMarquise BrownDolphins
10QBKirk CousinsRBAaron JonesRBSaquon BarkleyWRDavante AdamsWRJustin JeffersonFLEXAdam ThielenWRJahan DotsonTEGerald EverettDSTDolphinsKirk CousinsAaron JonesSaquon BarkleyDavante AdamsJustin JeffersonJahan DotsonGerald EverettAdam ThielenDolphins
11QBJalen HurtsRBJoe MixonRBAaron JonesFLEXSaquon BarkleyWRJustin JeffersonWRParris CampbellWRRomeo DoubsTETravis KelceDSTDolphinsJalen HurtsJoe MixonAaron JonesJustin JeffersonParris CampbellRomeo DoubsTravis KelceSaquon BarkleyDolphins
12QBPatrick MahomesRBJoe MixonRBSaquon BarkleyFLEXMarquise BrownWRMichael PittmanWRJuJu Smith-SchusterWRRandall CobbTETravis KelceDSTVikingsPatrick MahomesJoe MixonSaquon BarkleyMichael PittmanJuJu Smith-SchusterRandall CobbTravis KelceMarquise BrownVikings
13QBKirk CousinsRBAaron JonesRBSaquon BarkleyFLEXJustin JeffersonWRMichael PittmanWRAdam ThielenWRJahan DotsonTETravis KelceDSTGiantsKirk CousinsAaron JonesSaquon BarkleyMichael PittmanAdam ThielenJahan DotsonTravis KelceJustin JeffersonGiants
Sheet29
Cell Formulas
RangeFormula
T2:T13T2=B2
U2:U13U2=INDEX(FILTER(INDEX(A2:P2,1,SEQUENCE(1,8,2,2)),INDEX(A2:P2,1,SEQUENCE(1,8,1,2))="RB"),1,1)
V2:V13V2=INDEX(FILTER(INDEX(A2:P2,1,SEQUENCE(1,8,2,2)),INDEX(A2:P2,1,SEQUENCE(1,8,1,2))="RB"),1,2)
W2:W13W2=INDEX(FILTER(INDEX(A2:P2,1,SEQUENCE(1,8,2,2)),INDEX(A2:P2,1,SEQUENCE(1,8,1,2))="WR"),1,1)
X2:X13X2=INDEX(FILTER(INDEX(A2:P2,1,SEQUENCE(1,8,2,2)),INDEX(A2:P2,1,SEQUENCE(1,8,1,2))="WR"),1,2)
Y2:Y13Y2=INDEX(FILTER(INDEX(A2:P2,1,SEQUENCE(1,8,2,2)),INDEX(A2:P2,1,SEQUENCE(1,8,1,2))="WR"),1,3)
Z2:Z13Z2=INDEX(A2:Q2,MATCH("TE",A2:R2,0)+1)
AA2:AA13AA2=INDEX(A2:Q2,MATCH("FLEX",A2:R2,0)+1)
AB2:AB13AB2=R2
 
Upvote 0
Outstanding JamesCanale, I've literally spent 2 hours trying to solve :)

The actual raw format shows up as below, before my parsing of the file. Could you even provide a solution to save me a step of "cleaning" the original strings?

dk contest Book1.csv
ABCDEFGHI
1LineupQBRBRBWRWRWRTEFlex
2QB Matt Ryan RB Najee Harris RB Saquon Barkley FLEX Justin Jefferson WR Brandin Cooks WR Michael Pittman Jr. WR Jahan Dotson TE Travis Kelce DST Steelers
3QB Jameis Winston RB D'Andre Swift FLEX Saquon Barkley RB Dameon Pierce WR Justin Jefferson WR Michael Pittman Jr. WR Christian Kirk TE Travis Kelce DST Lions
4QB Trevor Lawrence RB Christian McCaffrey RB Saquon Barkley FLEX Justin Jefferson WR Christian Kirk WR Marvin Jones Jr. WR Jahan Dotson TE Travis Kelce DST Steelers
5QB Jalen Hurts RB Christian McCaffrey RB Saquon Barkley WR A.J. Brown WR Michael Pittman Jr. WR Jahan Dotson FLEX Travis Kelce TE Dallas Goedert DST Vikings
6QB Carson Wentz RB Christian McCaffrey RB Saquon Barkley WR Terry McLaurin WR Michael Pittman Jr. WR Christian Kirk FLEX Jahan Dotson TE Travis Kelce DST Falcons
dk contest Book1
 
Upvote 0
Do you have the TEXTSPLIT function yet?
 
Upvote 0
In that case you are probably better off separating the data out for the time being.
 
Upvote 0
MrExcelPlayground11.xlsx
ABCDEFGHIJKLMNOPQRS
19QB Matt Ryan RB Najee Harris RB Saquon Barkley FLEX Justin Jefferson WR Brandin Cooks WR Michael Pittman Jr. WR Jahan Dotson TE Travis Kelce DST Steelers QBMatt Ryan RBNajee Harris RBSaquon Barkley FLEXJustin Jefferson WRBrandin Cooks WRMichael Pittman Jr. WRJahan Dotson TETravis Kelce DSTSteelers
20QB Jameis Winston RB D'Andre Swift FLEX Saquon Barkley RB Dameon Pierce WR Justin Jefferson WR Michael Pittman Jr. WR Christian Kirk TE Travis Kelce DST Lions QBJameis Winston RBD'Andre Swift FLEXSaquon Barkley RBDameon Pierce WRJustin Jefferson WRMichael Pittman Jr. WRChristian Kirk TETravis Kelce DSTLions
21QB Trevor Lawrence RB Christian McCaffrey RB Saquon Barkley FLEX Justin Jefferson WR Christian Kirk WR Marvin Jones Jr. WR Jahan Dotson TE Travis Kelce DST Steelers QBTrevor Lawrence RBChristian McCaffrey RBSaquon Barkley FLEXJustin Jefferson WRChristian Kirk WRMarvin Jones Jr. WRJahan Dotson TETravis Kelce DSTSteelers
22QB Jalen Hurts RB Christian McCaffrey RB Saquon Barkley WR A.J. Brown WR Michael Pittman Jr. WR Jahan Dotson FLEX Travis Kelce TE Dallas Goedert DST Vikings QBJalen Hurts RBChristian McCaffrey RBSaquon Barkley WRA.J. Brown WRMichael Pittman Jr. WRJahan Dotson FLEXTravis Kelce TEDallas Goedert DSTVikings
23QB Carson Wentz RB Christian McCaffrey RB Saquon Barkley WR Terry McLaurin WR Michael Pittman Jr. WR Christian Kirk FLEX Jahan Dotson TE Travis Kelce DST Falcons QBCarson Wentz RBChristian McCaffrey RBSaquon Barkley WRTerry McLaurin WRMichael Pittman Jr. WRChristian Kirk FLEXJahan Dotson TETravis Kelce DSTFalcons
Sheet29
Cell Formulas
RangeFormula
B19:S23B19=LET(a,(FIND({"QB","RB","WR","TE","FLEX","DST"},A19,SEQUENCE(LEN(A19)))), b,SEQUENCE(ROWS(a)*COLUMNS(a)), c,SORT(UNIQUE(INDEX(a,1+INT((b-1)/COLUMNS(a)),1+MOD(b,COLUMNS(a))))), d,IF(ISERR(INDEX(c,SEQUENCE(ROWS(c)))),LEN(A19),INDEX(c,SEQUENCE(ROWS(c)))), e,INDEX(d,SEQUENCE(ROWS(d)-1,1,1)), f,INDEX(d,SEQUENCE(ROWS(d)-1,1,2)), g,f-e, h,MID(A19,e,g), i,FIND(" ",h), j,LEFT(h,i-1), k,MID(h,i+1,99), l,SEQUENCE(ROWS(h)*2), m,IF(ISODD(l),INDEX(j,INT((l+1)/2)),INDEX(k,INT((l+1)/2))), TRANSPOSE(m))
Dynamic array formulas.
 
Upvote 0
Solution
MrExcelPlayground11.xlsx
ABCDEFGHIJKLMNOPQRS
19QB Matt Ryan RB Najee Harris RB Saquon Barkley FLEX Justin Jefferson WR Brandin Cooks WR Michael Pittman Jr. WR Jahan Dotson TE Travis Kelce DST Steelers QBMatt Ryan RBNajee Harris RBSaquon Barkley FLEXJustin Jefferson WRBrandin Cooks WRMichael Pittman Jr. WRJahan Dotson TETravis Kelce DSTSteelers
20QB Jameis Winston RB D'Andre Swift FLEX Saquon Barkley RB Dameon Pierce WR Justin Jefferson WR Michael Pittman Jr. WR Christian Kirk TE Travis Kelce DST Lions QBJameis Winston RBD'Andre Swift FLEXSaquon Barkley RBDameon Pierce WRJustin Jefferson WRMichael Pittman Jr. WRChristian Kirk TETravis Kelce DSTLions
21QB Trevor Lawrence RB Christian McCaffrey RB Saquon Barkley FLEX Justin Jefferson WR Christian Kirk WR Marvin Jones Jr. WR Jahan Dotson TE Travis Kelce DST Steelers QBTrevor Lawrence RBChristian McCaffrey RBSaquon Barkley FLEXJustin Jefferson WRChristian Kirk WRMarvin Jones Jr. WRJahan Dotson TETravis Kelce DSTSteelers
22QB Jalen Hurts RB Christian McCaffrey RB Saquon Barkley WR A.J. Brown WR Michael Pittman Jr. WR Jahan Dotson FLEX Travis Kelce TE Dallas Goedert DST Vikings QBJalen Hurts RBChristian McCaffrey RBSaquon Barkley WRA.J. Brown WRMichael Pittman Jr. WRJahan Dotson FLEXTravis Kelce TEDallas Goedert DSTVikings
23QB Carson Wentz RB Christian McCaffrey RB Saquon Barkley WR Terry McLaurin WR Michael Pittman Jr. WR Christian Kirk FLEX Jahan Dotson TE Travis Kelce DST Falcons QBCarson Wentz RBChristian McCaffrey RBSaquon Barkley WRTerry McLaurin WRMichael Pittman Jr. WRChristian Kirk FLEXJahan Dotson TETravis Kelce DSTFalcons
Sheet29
Cell Formulas
RangeFormula
B19:S23B19=LET(a,(FIND({"QB","RB","WR","TE","FLEX","DST"},A19,SEQUENCE(LEN(A19)))), b,SEQUENCE(ROWS(a)*COLUMNS(a)), c,SORT(UNIQUE(INDEX(a,1+INT((b-1)/COLUMNS(a)),1+MOD(b,COLUMNS(a))))), d,IF(ISERR(INDEX(c,SEQUENCE(ROWS(c)))),LEN(A19),INDEX(c,SEQUENCE(ROWS(c)))), e,INDEX(d,SEQUENCE(ROWS(d)-1,1,1)), f,INDEX(d,SEQUENCE(ROWS(d)-1,1,2)), g,f-e, h,MID(A19,e,g), i,FIND(" ",h), j,LEFT(h,i-1), k,MID(h,i+1,99), l,SEQUENCE(ROWS(h)*2), m,IF(ISODD(l),INDEX(j,INT((l+1)/2)),INDEX(k,INT((l+1)/2))), TRANSPOSE(m))
Dynamic array formulas.

Thank you thank you!!!!!!!!
 
Upvote 0
MrExcelPlayground11.xlsx
ABCDEFGHIJKLMNOPQRS
19QB Matt Ryan RB Najee Harris RB Saquon Barkley FLEX Justin Jefferson WR Brandin Cooks WR Michael Pittman Jr. WR Jahan Dotson TE Travis Kelce DST Steelers QBMatt Ryan RBNajee Harris RBSaquon Barkley FLEXJustin Jefferson WRBrandin Cooks WRMichael Pittman Jr. WRJahan Dotson TETravis Kelce DSTSteelers
20QB Jameis Winston RB D'Andre Swift FLEX Saquon Barkley RB Dameon Pierce WR Justin Jefferson WR Michael Pittman Jr. WR Christian Kirk TE Travis Kelce DST Lions QBJameis Winston RBD'Andre Swift FLEXSaquon Barkley RBDameon Pierce WRJustin Jefferson WRMichael Pittman Jr. WRChristian Kirk TETravis Kelce DSTLions
21QB Trevor Lawrence RB Christian McCaffrey RB Saquon Barkley FLEX Justin Jefferson WR Christian Kirk WR Marvin Jones Jr. WR Jahan Dotson TE Travis Kelce DST Steelers QBTrevor Lawrence RBChristian McCaffrey RBSaquon Barkley FLEXJustin Jefferson WRChristian Kirk WRMarvin Jones Jr. WRJahan Dotson TETravis Kelce DSTSteelers
22QB Jalen Hurts RB Christian McCaffrey RB Saquon Barkley WR A.J. Brown WR Michael Pittman Jr. WR Jahan Dotson FLEX Travis Kelce TE Dallas Goedert DST Vikings QBJalen Hurts RBChristian McCaffrey RBSaquon Barkley WRA.J. Brown WRMichael Pittman Jr. WRJahan Dotson FLEXTravis Kelce TEDallas Goedert DSTVikings
23QB Carson Wentz RB Christian McCaffrey RB Saquon Barkley WR Terry McLaurin WR Michael Pittman Jr. WR Christian Kirk FLEX Jahan Dotson TE Travis Kelce DST Falcons QBCarson Wentz RBChristian McCaffrey RBSaquon Barkley WRTerry McLaurin WRMichael Pittman Jr. WRChristian Kirk FLEXJahan Dotson TETravis Kelce DSTFalcons
Sheet29
Cell Formulas
RangeFormula
B19:S23B19=LET(a,(FIND({"QB","RB","WR","TE","FLEX","DST"},A19,SEQUENCE(LEN(A19)))), b,SEQUENCE(ROWS(a)*COLUMNS(a)), c,SORT(UNIQUE(INDEX(a,1+INT((b-1)/COLUMNS(a)),1+MOD(b,COLUMNS(a))))), d,IF(ISERR(INDEX(c,SEQUENCE(ROWS(c)))),LEN(A19),INDEX(c,SEQUENCE(ROWS(c)))), e,INDEX(d,SEQUENCE(ROWS(d)-1,1,1)), f,INDEX(d,SEQUENCE(ROWS(d)-1,1,2)), g,f-e, h,MID(A19,e,g), i,FIND(" ",h), j,LEFT(h,i-1), k,MID(h,i+1,99), l,SEQUENCE(ROWS(h)*2), m,IF(ISODD(l),INDEX(j,INT((l+1)/2)),INDEX(k,INT((l+1)/2))), TRANSPOSE(m))
Dynamic array formulas.
Ok, I have acquired textsplit - is there a better/different way than what you showed?
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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