So, excel can do matrix calculations. That’s useful. But why the hell didn’t it give us a function to create an identity matrix.

Here’s a quick hack (no programming) to generate an identity matrix.

Step 1: block out the N by N matrix you want to be the identity matrix. Fill it with “x”. Easiest is to make this in a new worksheet.

Step 2: type in the formula into cell A1:

=if(row(A1)=column(A1),1,0)

Step 3: Fill this into your n x n space. CTRL-D and CTRL-R work well.

Done.

Note that for matrix inverse / inversion (MINVERSE), there is a 52×52 limit on the size of the matrix.

A link to using excel’s matrix functions I found helpful

http://www.stanford.edu/~wfsharpe/mia/mat/mia_mat4.htm

### Like this:

Like Loading...

*Related*

The 52×52 limit was for Office 2003. It’s higher in Office 2007.

Comment by howardchong — March 1, 2010 @ 10:49 pm