Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2003
    Location
    Phoenix, Arizona, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    String as Index Argument (Excel2003)

    I'm using the Index function but want to change the 'array' argument depending on other cells. For example, when I enter =index(GGAU2003AC,0,0) into multiple cells and enter it as an array, it pulls an already named range (GGAU2003AC) and enters the entire range in the cells. The problem is that I want to create the array name based on other cells, e.g., =index(concatenate(d1,d2,d3),0,0) results in an error because concatenate passes its result as a string and the index function apparently doesn't like GGAU2003AC passed to it as "GGAU2003AC" with quotes.

    I've screwed around with VBA, although I'm not very adept, and got my code to do the same thing as the index function, but it still doesn't like the array name as a string. Any ideas?

    Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: String as Index Argument (Excel2003)

    Try =INDEX(INDIRECT(CONCATENATE(D1,D2,D3)),0,0) or =INDEX(INDIRECT(D1&D2&D3),0,0)

  3. #3
    New Lounger
    Join Date
    Dec 2003
    Location
    Phoenix, Arizona, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: String as Index Argument (Excel2003)

    Brilliant! <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23> Now I need to do my research into the Indirect function to satisfy my curiosity. Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •