View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default How do I get the diagonal of a matrix from excel?

"JoeNiner" wrote:
How can I get the diagonal of a matrix returned as a single column vector?


One try ..

Assuming a 4 x 4 grid in B2:E5 (top left cell is B2)

Perhaps this expression:
=OFFSET(B2,ROW(INDIRECT("1:4"))-1,ROW(INDIRECT("1:4"))-1)

Or maybe this expression below,
array-entered into a 4 cell columnar range, say into B20:B23 :
=INDEX(B2:E5,ROW(INDIRECT("1:4")),ROW(INDIRECT("1: 4")))

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---