Using FILTER in INDIRECT to calculate row value

Ludwig

Board Regular
Joined
Apr 7, 2003
Messages
97
Office Version
  1. 365
Platform
  1. Windows
I wanted the text in "friendly name" of a HYPERLINK to insert the calculated cell reference value you would be jumping to.

I used INDIRECT within the "friendly name" value. A simplified example of the formula is -
Excel Formula:
=INDIRECT( "B" & INDEX( FILTER( tbOdometers[Row Nbr], tbOdometers[Odometer] = "", MAX( tbOdometers[Row Nbr] ) + 1  ), 1 ) )
However, this results in a #VALUE! error.

But coding just the value inside INDIRECT in a cell, it works.
Excel Formula:
="B" & INDEX( FILTER( tbOdometers[Row Nbr], tbOdometers[Odometer] = "", MAX( tbOdometers[Row Nbr] ) + 1  ), 1 )

But if I put the INDEX( FILTER( ... portion of the formula in a cell directly and reference that within INDIRECT, that cell returns the correct value using INDIRECT.

Using Evaluate Formula, INDIRECT is being passed a value with braces round the string value (ie it's a 1-value array), rather than just the string value. Using index should bring just one value, not an array with 1 value surely?
Screenshot 2024-02-16 054848.png
But by referencing a helper cell this does not occur.

How can I get INDIRECT to function correctly using INDEX( FILTER(... as first shown without needing a helper cell?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Found a solution. While trying TEXT around the INDEX function didn't work, TEXTJOIN does - ie combine the "B" and INDEX value *then* use it as a string in INDIRECT.

Excel Formula:
=INDIRECT( TEXTJOIN( "", FALSE, "B",  INDEX( FILTER( tbOdometers[Row Nbr], tbOdometers[Odometer] = "", MAX( tbOdometers[Row Nbr] ) + 1  ), 1 )  ) )


Still have no idea why INDEX alone doesn't work, but at least TEXTJOIN does the job.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top