0

I have a table that is referencing a pivot table on the same sheet. I added a form control scroll bar to be able to flip through the data without changing the view.

The headers of that table are linked to the headers of the pivot table. I am trying to write the =INDEX(L3:L$17,$D$6) formula so that the column info is adjusted automatically.

I managed to use the columnletter to convert the match of the header to the correct letter but don't know how to adjust the Index formula to use that info.

The goal is to change the index column array reference whenever I change the header dependency to another column.

enter image description here

change to Header from City to Street, should change the Index formula to use column M instead of L

enter image description here

1 Answer 1

1

The Match function will search the header word in the pivot table. So you can change the words in the header and get the results for it without changing the formula.

   Option 1  E8=    =INDEX($L$3:$N$26;$F$3+ROWS($E$8:E8)-1;MATCH(Q$6;$L$2:$N$2;0))

Option 2  Q7=INDEX($L3:$N$26;$F$3;MATCH(Q$6;$L$2:$N$2;0))

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. Apologies for lack of clarity. I want the index formula to change according to the column referred to in the header. So if the header (city) refers to column L, the index array is to capture L3:L17. If there would be a change in header dependent to e.g. column M, the formula is to update to M3:M17 without the user having to manually change the Index formula.
i added another picture to maybe better explain. If I would change the header from City to Street, the index formulas below, should automatically change from column L to M based on the columnletter match result.
@hbg i updated the answer. I think it is that you want

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.