Automated Table Of Contents - Adding Details from Last row of related page

Solution 1:

Change this portion of the second formula (the unsuccessful one):

MAX(("'"&A9&"  &  '!"&  A:A  <>  ""  "")

(noting the areas I've stretched out with spaces) to this:

MAX((INDIRECT("'"&A9&"'!"&"A:A")<>"")

Presently there are several sins in this stretch. First is you cannot simply build the string and use it directly as an address. That is the use of INDIRECT(), to take such and do such. You clearly know this, so must have just forgotten the step when making it out.

The second sin is the extra ampersand (&) in the bit of string after "A9"... no bueno. Gotta remove that.

The third is that there are no doublequotes around the A:A portion. It must have them.

Fourth and final is the string of four doublequotes on the other side of the comparison. It needs to be TWO of them, not four.

Once you do those things, it works like a charm.