Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Changing part of cell reference in INDEX - MATCH formula

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Changing part of cell reference in INDEX - MATCH formula

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

Without having to use INDIRECT, see if this does what you want:

=IFERROR(INDEX(Spilletider!$O:$U;MATCH($B2;INDEX(S pilletider!$A:$D;G1;0);0);G1);0)

--
Biff
Microsoft Excel MVP


"HebbeLille" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Changing part of cell reference in INDEX - MATCH formula

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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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

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

Tested out this one, and it works:

=IFERROR(INDEX(INDIRECT("'Spilletider'!"&"O"&G$1&" :U"&G$1);MATCH($B2;INDIRECT("'Spilletider'!A2:D"&G $1);0));0)

But, as you can see, I had to remove the !"&"A"&G$1"&":D" with !A2:D".

Any idea how I can get this part also to work as intended?

--
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



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Changing part of cell reference in INDEX - MATCH formula

Think this should work, as-is (albeit untested*):
=IFERROR(INDEX(INDIRECT("'Spilletider'!O"&G$1&":R" &G$1);MATCH($B2;INDIRECT("'Spilletider'!A"&G$1&":D "&G$1);0));0)
where the variable is G1: 2

*as my xl03 doesn't have IFERROR, and my separators are commas, not
semi-colons. But I believe the expression above should work for you

voila? hit the YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"HebbeLille" wrote:
Tested out this one, and it works:

=IFERROR(INDEX(INDIRECT("'Spilletider'!"&"O"&G$1&" :U"&G$1);MATCH($B2;INDIRECT("'Spilletider'!A2:D"&G $1);0));0)

But, as you can see, I had to remove the !"&"A"&G$1"&":D" with !A2:D".

Any idea how I can get this part also to work as intended?


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

Hi, and thanks for the effort.

You are quite right that it works for this particular cell, but when the
formula is like this, it doesn't automaticly change when copying in the
spreadsheet.
The formula now is locked to cell G1.

The purpose of the formula is to be locked to row 1, and automaticly change
the column G to H, I, J, K and so on.

Thanks for helping, appreciate if there is a solution of the last tricky bit..
--
HebbeLille


"Max" wrote:

Think this should work, as-is (albeit untested*):
=IFERROR(INDEX(INDIRECT("'Spilletider'!O"&G$1&":R" &G$1);MATCH($B2;INDIRECT("'Spilletider'!A"&G$1&":D "&G$1);0));0)
where the variable is G1: 2

*as my xl03 doesn't have IFERROR, and my separators are commas, not
semi-colons. But I believe the expression above should work for you

voila? hit the YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"HebbeLille" wrote:
Tested out this one, and it works:

=IFERROR(INDEX(INDIRECT("'Spilletider'!"&"O"&G$1&" :U"&G$1);MATCH($B2;INDIRECT("'Spilletider'!A2:D"&G $1);0));0)

But, as you can see, I had to remove the !"&"A"&G$1"&":D" with !A2:D".

Any idea how I can get this part also to work as intended?


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Changing part of cell reference in INDEX - MATCH formula

Think I lost you there. The variable cell is defined in the formula as: G$1,
which means when you copy it across it'll change to H$1, I$1, etc which is as
per your intents as posted earlier?
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"HebbeLille" wrote:
Hi, and thanks for the effort.

You are quite right that it works for this particular cell, but when the
formula is like this, it doesn't automaticly change when copying in the
spreadsheet.
The formula now is locked to cell G1.

The purpose of the formula is to be locked to row 1, and automaticly change
the column G to H, I, J, K and so on.

Thanks for helping, appreciate if there is a solution of the last tricky bit..


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a changing cell reference as part of a workbook name 2 link Jason Excel Discussion (Misc queries) 2 June 12th 09 04:24 PM
INDEX - MATCH - OFFSET By Reference Bam Excel Worksheet Functions 2 May 28th 09 09:04 AM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
Using the result of formula as part of reference to a cell in form Victor Excel Worksheet Functions 8 May 2nd 07 10:53 PM
Index match formula works in for one worksheet reference but not another [email protected] Excel Worksheet Functions 2 October 10th 06 06:35 PM


All times are GMT +1. The time now is 09:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"