View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
HebbeLille HebbeLille is offline
external usenet poster
 
Posts: 7
Default Changing part of cell reference in INDEX - MATCH formula

Sorry, I get an error in the last two G$1's. (The last INDIRECT).

Seems to me the MATCH doesn't like INDIRECT as lookup array.

INDIRECT("'Spilletider'!"&"A"&G$1"&":D"&G$1), Excel points out G$1 to be an
error.

--
HebbeLille


"Max" wrote:

For it to work, you'd need to use INDIRECT to resolve the concatenated
strings (with the embedded variables) that you're trying to compose in your
expression, something like this, untested:
=IFERROR(INDEX(indirect("'Spilletider'!"&"O"&G$1&" :U"&G$1);MATCH($B2;indirect("'Spilletider'!"&"A"&G $1"&":D"&G$1);0));0)

--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"HebbeLille" wrote:
Hopefully somebody can tell me what's wrong with this formula:

=IFERROR(INDEX("Spilletider!"&O&G$1:U&G$1;MATCH($B 2;"Spilletider!"&A&G$1:D&G$1;0));0)

This one works:

=IFERROR(INDEX(Spilletider!$O$2:$R$2;MATCH($B2;Spi lletider!$A$2:$D$2;0));0)

but I want to replace the number 2 in
$O$2, $R$2, $A$2 and $D$2 with the value from row 1.
(In the example the value 2 is in cell G1 in the same tab as the formula is
in,
and the column shall change when the formula is copied one cell to the
right, the value G should be H.)

The value $B2 shall not be changed, the value here changes for each row.

--
HebbeLille