Using a string from a cell as the "reference" argumet in Calc's INDEX function

I am trying something that I thought would be simple, but is eluding me. In one sheet, I have used Data | Define Range to give names to the data in particular columns (say Dog, Cat, Turtle). In another sheet, column A defines each row as a Dog, Cat, or Turtle. Column B contains a number corresponding to the row of Dog, Cat, or Turtle I wish to retrieve for that row. I had thought to retrieve that data with =INDEX(A1; B1). This, however, returns Err: 502. If I manually do =INDEX(Dog; B1), however, then it works as expected. It seems that while B1 is resolving to a number that correctly indicates the row of Dog, A1 is not resolving to a string. Am I missing something, like a function to force A1 to resolve to a string properly, or does INDEX not support this functionality?

Thank you.

Dog or "Dog" ??
.
If the first works, you have created a Name first?

It looks like you are looking for =INDEX(INDIRECT(A1);B1)

4 Likes

This was it. I could have sworn I tried using INDIRECT, but apparently not, or at least not correctly. Thank you so much.