Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to create a diagonal matrix from column with diagonal values using a dynamic array function

I have an excel sheet with a column with values I would like to use as a diagonal matrix for some matrix multiplication. I would like to achieve this without actually displaying the diagonal matrix, but only displaying the result of some matrix operation on the diagonal matrix as shown in the example in the picture. For this purpose I would like a dynamic array formula to create the diagonal matrix from which the result can be fed into for example MMULT-function without displaying the diagonal matrix. Any ideas of how this can be done?

Column with diagonal values, and diagonal matrix

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Can try-

=LET(x,IF(MUNIT(ROWS(B3:B5))=1,B3:B5,0),MMULT(x,x))

Another way with MAKEARRAY()

=MAKEARRAY(3,3,LAMBDA(a,b,a*b))*(MUNIT(3))

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading