This release (June 2012, V.1.1) includes about 60 basic matrix and vector functions for MS Excel users and macro (VBA, Visual Basic for Applications) programmers. All these functions are written with the native macro language (VBA) of excel.
Basic Matrix and Vector Functions with VBA/Excel (October2012, V1.3)
BasicMatrixAndVectorFunctionsInVBA-V1_3.xlsm (September2012, V1.3)
Why would you need matrix operations in excel?
- You are a proficient excel user and programmer, and you want to do everything in excel, if possible.
- You want to implement complex matrix calculations, simulations and optimizations easily with macros (VBA) in excel.
- You want to translate the matrix functions and scripts written with mathematical applications like matlab and R into the excel VBA environment, so that you can profit from built in functions of excel like charting, reporting and data storage.
Your first VBA procedure with matrix functions

Sub mytest1()
Dim Vin() As Double, Vout() As Double, Vind() As Double
Vin = FQ_var_to_vector([{5,2,8,10,4,5,8,1}])
Call FQ_vector_sort(Vin, Vout:=Vout,ind:=Vind,SortOpt:=nAscending)
Debug.Print "Sorted vector Vout = " & Chr(10) & FQ_vector_format(Vout)
End Sub
This procedure creates first a vector with 8 elements, then sorts them in ascending order, and finally prints the resultant sorted vector into the immediate window (press F5 to execute the procedure). Compare this with the corresponding matlab code:
Vin = [5,2,8,10,4,5,8,1]
[Vout, Vind] = sort(Vin);
Vout
Your second VBA procedure with matrix functions

This worksheet function reads the elements of a matrix from the given worksheet range (InputRange), calculates the inverse of the matrix and writes the resultant inverse matrix back into the given worksheet range (OutputRange). We can test this function with the test procedure below:
Sub TEST_FQS_matrix_inverse()
Dim r_in As Range, r_out As Range
Set r_in = ThisWorkbook.Sheets("examples").Range("A4:D7")
Set r_out = ThisWorkbook.Sheets("examples").Range("F4:G5")
Call FQS_matrix_inverse(r_in, r_out)
End Sub

Next steps
Here is how you can contribute and get involved:
- By bringing interesting questions and ideas to the related community forum
- By subscribing to our news for significant release updates for matrix functions with VBA/Excel:
[fbcomments]
Copyright secured by Digiprove © 2012 Tunc Ali Kütükcüoglu 


Matrix determinant function is added to the new version V1.2 (July 2012). All the VBA scripts published so far for generating test data (as all possible attribute value combinations) can be found in Module3 of the downloadable excel file.
Hi,
thanks very much for these functions.
I’m not a very experienced vba user, and the functions included in the file provided by Finaquant, helped me a lot in a project where I had to use matrix operations extensively.
Keep up the good work
Hi,
I am trying to download this spreadsheet to do some comparisons with some code I have written but when I click on it it looks like the download does not exist. At least this is the message I get. Any ideas why it is doing that?
Thanks a lot
Laki
Hello Laki, apparently there was a temporary configuration error in the download manager which is then corrected. Downloads should be working by now. Thank you for your warning.
thanks