INDIRECT and INDEX error

aaron1000

New Member
Joined
Jun 9, 2011
Messages
10
Hi Folks, I am migrating a number of formulas to make use of the INDIRECT funtion (see history here http://www.mrexcel.com/forum/showthread.php?t=556583).

One formula is giving me difficulties. It grabs the last value of a column in a worksheet and displays it in a 'calcs' worksheet.

I have it working correctly when pasted into individual worksheets:
=INDEX(C:C,MATCH(9.99999999999999E+307,C:C))

but when I move it to my 'calcs' worksheet and add in the indirect funtion to reference the original worksheet, I get the old #REF error which I believe its telling me it can't resolve the location:
=INDEX(INDIRECT("'"&ROW()&"'!C"):INDIRECT("'"&ROW()&"'!C"),MATCH(9.99999999999999E+307,INDIRECT("'"&ROW()&"'!C"):INDIRECT("'"&ROW()&"'!C")))

Appreciate any help on this.

cheers
Aaron
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
What is this supposed to return?

INDIRECT("'"&ROW()&"'!C")

If in A1 you would get:

INDIRECT('1'!C)

which is not a valid reference.
 

aaron1000

New Member
Joined
Jun 9, 2011
Messages
10
Hi, so what your saying is that where '1'!C is referenced with INDIRECT("'"&ROW()&"'!C") isn't going to work because INDIRECT function can't be used as a column reference...only as a cell reference.

In that case is there another way I can increment the worksheet reference sequentially by one so that when I copy the formula down in the 'calcs' worksheet it automatically increments. For example the end result I want is:

=INDEX('1'!C:C,MATCH(9.99999999999999E+307,'1'!C:C))
=INDEX('2'!C:C,MATCH(9.99999999999999E+307,'2'!C:C))
=INDEX('3'!C:C,MATCH(9.99999999999999E+307,'3'!C:C))
.
.
.
=INDEX('250'!C:C,MATCH(9.99999999999999E+307,'250'!C:C))


cheers
Aaron
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Oh I see:

=INDEX(INDIRECT("'"&ROW()&"'!C:C"),MATCH(9.99999999999999E+307,INDIRECT("'"&ROW()&"'!C:C")))
 

Forum statistics

Threads
1,082,323
Messages
5,364,579
Members
400,809
Latest member
formulasataglance

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top