Dynamic Index Reference

Kaiser958

New Member
Joined
Jan 19, 2023
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
I'm having an issue trying to logic out how to create a looping reference for an INDEX or MATCH formula. What I require is for AR3 and down to represent the index location of S2 and down. I need AR to cycle through that index n number of times where n is the value in the Y column associated the index in Y and then increment into the next index. I can not do this with VBA due to organization restrictions and I really want to keep this with formulas and helper cells, no power query. Any advice is appreciated.
 

Attachments

  • Index Ref.PNG
    Index Ref.PNG
    27.9 KB · Views: 14
Yh I copied this formula exactly as you had it and its not working.

Excel Formula:
=IF(COUNTA($AR$1:$AR1)<SUM($Y$2:$Y$100),IFERROR(IF(COUNTIF($AR$1:$AR1,$AR1)=VLOOKUP($AR1,$S$2:$Y$100,7,0),IFERROR(INDEX($S$2:$S$100,MATCH($AR1,$S$2:$S$100,1)+1,""),AR1),$S2),""))

The VLOOKUP is kicking out a N/A on AR2
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I got it! I was missing a parenthesis after the +1. Thank you so much! The final formula is:
Excel Formula:
=IF(COUNTA($AR$1:$AR1)<SUM($Y$2:$Y$100),IFERROR(IF(COUNTIF($AR$1:$AR1,$AR1)=VLOOKUP($AR1,$S$2:$Y$100,7,0),IFERROR(INDEX($S$2:$S$100,MATCH($AR1,$S$2:$S$100,1)+1),""),AR1),$S2),"")

I will likely make small changes to further improve but this is absolutely what I needed!
 
Upvote 0
Solution
Do the column S values always start at 1 and increase by 1 each row?

If so, try this in AR2 (assuming AR1 is empty like your images)
Excel Formula:
=IF(ROWS(AR$2:AR2)>SUM(Y$2:Y$100),"",AR1+(COUNTIF(AR$1:AR1,AR1)=IFNA(VLOOKUP(AR1,S$2:Y$100,7),0)))

or possibly even this
Excel Formula:
=IF(ROWS(AR$2:AR2)>SUM(Y$2:Y$100),"",AR1+(COUNTIF(AR$1:AR1,AR1)=N(INDEX(Y$1:Y$100,AR1+1))))

If not, can you tell us more about what might be in column S?

@Flashbond
I would have changed the solution post to yours if you had provided the formula actually in post 9
Please do not make posts like that where the answer you are suggesting is only in a linked file - see #4 (especially the last two paragraphs) of the Forum Rules
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,569
Members
449,038
Latest member
Guest1337

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