Just a quick query really.
I have been passed an array formula which basically returns the final word in a cell of text, as indicated by the final word being preceded by a space.
The formula is:
=RIGHT(TRIM(A2),LEN(TRIM(A2))-MAX(IF(MID(LEFT(TRIM(A2),20),ROW(INDIRECT("1:20")),1)=" ", ROW(INDIRECT("1:20")))))
entered as an array formula.
Basically the formula returns a persons surname.
I am aware of using indirect to return indirect cell values, but how does the above formula work? Just having difficulty getting my brain round the ROW(INDIRECT(“1:20”)) bit.
Is it checking characters 1:20 of the cell? And how does it know its the last space in a cell. e.g. if I have say Mr K L Smith, then the result is Smith. It’s great and it works but I would just like to know how.
TIA
Alan