INDIRECT function returning REF#

D

Don Kline

I'm trying to find the start of a column on a worksheet. The column start is
based on two variables - row number and column number.

The value of RC2 = "value_Gauranteed Cash Value".

The value of R1C3 is 11. This is the in whiich the "value_Gauranteed Cash
Value" is to be found by the match

"XMLSource" is a worksheet in the same workbook.

The correct answer would be for the function to return 46 - the row number
for the first exact match to the value in RC2.

=MATCH(RC2,INDIRECT("XMLSource!R1C"&R1C3&":R966C"&R1C3),0)

The match is supposed to tell me where in column 11 does it find the exact
match for the value in RC2. What I get is a REF#.

What am I doing wrong?
 
B

Bob Bridges

I didn't examine this thoroughly, just enough to spot the first error. So
there may be others, but the obvious one is this: INDIRECT assumes that the
string you're handing it expresses the address in A1 format. Since you're
using R1C1, you need to add an extra parameter to the INDIRECT function, like
this:

=MATCH(RC2,INDIRECT("XMLSource!R1C"&R1C3&":R966C"&R1C3,FALSE),0)

I prefer R1C1 myself, which is how I know. :)
 
D

Don Kline

A thousand blessings for your speedy and astute reply. I had forgotten that
extra parameter for the R1C1 format.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top