View Single Post
  #1   Report Post  
kevin frisch
 
Posts: n/a
Default What is ROW(INDIRECT("1:40")) doing? (array formula)

I have a several _array_ formulas (written by someone else) that are breaking
up a long text string into smaller parts (without splitting a word in half).
I'm trying to usnerstand what the function is actually doing.
The first function (which pulls out the first 40 characters (rounded down to
the nearest full word) is the following:

=IF(LEN(A11)<=40,A11,LEFT(TRIM(A11),MAX((MID(TRIM( A11),ROW(INDIRECT("1:40")),1)=" ")*ROW(INDIRECT("1:40")))))

I thought I knew how both the "row" function and the "indirect" functions
worked, but obviuosly I don't... ahhhhh