How to perform singular value decomposition using MS Excel?

In summary, when looking to perform SVD on a matrix in Excel, there are a few options available. One can write a macro in VBA or search for existing macros. It may also be helpful to perform a Google search for "excel singular value decomposition" to find tutorials and examples of SVD code. Alternatively, one could import the Excel sheet into a programming language like MATLAB or Octave to perform the desired linear algebra.
  • #1
Adel Makram
635
15
I have a matrix of data and I want to do SVD using excel, is it possible?
 
Computer science news on Phys.org
  • #2
You can write a macro in VBA, or look for existing macros. I don't see a practical way to do it with formulas alone.
 
  • #3
So how to write the code for SVD in excel for mn matrix?
 
  • #4
In the same way as in every other programming language. There are tutorials for writing macros in Excel, for VBA syntax, and there are examples of SVD code as well.
 
  • #5
Have you tried a Google search for something like "excel singular value decomposition"? That search turns up results that look promising, although I haven't investigated any of them myself.
 
  • Like
Likes S.G. Janssens
  • #6
mfb said:
In the same way as in every other programming language. There are tutorials for writing macros in Excel, for VBA syntax, and there are examples of SVD code as well.
I do not know the programming language but I can copy the code and use it according to the problem I have. That is why I created this thread.
 
  • #7
So what do you expect, that others do google searches for you when you can do that as well?
 
  • Like
Likes S.G. Janssens
  • #8
mfb said:
So what do you expect, that others do google searches for you when you can do that as well?
I expect a code. Searching in google is non-specific but asking questions here would be more helpful.
 
  • #9
excel_svd.png


This is what I got. It looks promising. Why don't you try to reproduce the above by performing a similar Google search?
 
  • #10
Krylov said:
View attachment 108457

This is what I got. It looks promising. Why don't you try to reproduce the above by performing a similar Google search?
I did but I didn't find a reproducible code. For example the first link discusses the theoretical background. There is however, a code in the second link but it is only for 3/2 matrix or something. I need the code that can fit for any matrix.
 
  • #11
Adel Makram said:
I did but I didn't find a reproducible code. For example the first link discusses the theoretical background. There is however, a code in the second link but it is only for 3/2 matrix or something. I need the code that can fit for any matrix.
What about the 4th link? It is to a journal article that received quite a few (114, apparently) citations. I checked and the article is available free of charge. Macros seem downloadable as well.

In general you will often have to adapt (research) code that you find online to suit your own specific needs. This is something that requires a bit of practice. I am quite sure that among those links you will find code that either works straight away or only requires minor modifications.
 
  • Like
Likes CalcNerd
  • #12
Another option that I have applied successfully in the past, is to import the relevant Excel sheet in MATLAB and then do whatever linear algebra that you would like. (If you do not have MATLAB, you could try to export the Excel sheet to .CSV format and then use Octave instead.)
 
  • Like
Likes CalcNerd
  • #13
Krylov said:
Another option that I have applied successfully in the past, is to import the relevant Excel sheet in MATLAB and then do whatever linear algebra that you would like. (If you do not have MATLAB, you could try to export the Excel sheet to .CSV format and then use Octave instead.)
What is CSV?
 
  • #14
  • Like
Likes CalcNerd

Related to How to perform singular value decomposition using MS Excel?

1. How do I access the singular value decomposition function in MS Excel?

To access the singular value decomposition function in MS Excel, you will need to enable the Analysis ToolPak add-in. This can be done by going to the File menu, selecting Options, then clicking on Add-Ins. From there, you can select Analysis ToolPak and click on the Go button to enable it.

2. Can I perform singular value decomposition on a matrix in MS Excel?

Yes, you can perform singular value decomposition on a matrix in MS Excel. The SVD function in Excel allows you to input a range of cells containing the matrix data. However, the matrix must be a square matrix, with the same number of rows and columns.

3. What is the purpose of using singular value decomposition in MS Excel?

Singular value decomposition is used to break down a matrix into its constituent parts in order to perform various calculations and analyses. It is commonly used in data analysis, signal processing, and image processing.

4. How do I interpret the results of singular value decomposition in MS Excel?

The result of the singular value decomposition in MS Excel is a set of three matrices: U, S, and V. The U matrix represents the left singular vectors, the S matrix contains the singular values, and the V matrix represents the right singular vectors. These matrices can be used for further calculations and analysis.

5. Is it possible to perform singular value decomposition on a large dataset in MS Excel?

Yes, it is possible to perform singular value decomposition on large datasets in MS Excel. However, the size of the dataset may impact the performance and speed of the calculation. It is recommended to use specialized software or programming languages for large datasets.

Similar threads

  • Computing and Technology
Replies
16
Views
2K
  • Computing and Technology
Replies
10
Views
1K
  • Computing and Technology
Replies
1
Views
553
  • Computing and Technology
Replies
5
Views
1K
  • Computing and Technology
Replies
3
Views
2K
  • Computing and Technology
Replies
7
Views
910
Replies
9
Views
1K
Replies
1
Views
733
  • Atomic and Condensed Matter
Replies
1
Views
827
  • Computing and Technology
Replies
5
Views
1K
Back
Top