How to perform singular value decomposition using MS Excel?

Click For Summary

Discussion Overview

The discussion revolves around performing Singular Value Decomposition (SVD) using Microsoft Excel. Participants explore various methods, including the use of VBA macros, and express challenges in finding suitable code for different matrix sizes.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Exploratory

Main Points Raised

  • One participant asks if it is possible to perform SVD in Excel.
  • Another suggests writing a macro in VBA or finding existing macros, indicating that formulas alone may not suffice.
  • A request for specific code for SVD in Excel is made, highlighting a lack of programming knowledge but a willingness to use provided code.
  • Some participants recommend searching online for resources related to SVD in Excel, suggesting that there are promising results available.
  • Concerns are raised about the specificity of online search results, with one participant noting that some links provide theoretical background rather than practical code.
  • Another participant mentions the need to adapt found code to fit specific requirements, emphasizing that this may require practice.
  • One participant shares a successful alternative approach of importing Excel data into MATLAB for linear algebra operations, suggesting Octave as a free alternative.
  • A question about the CSV format is raised, leading to a brief explanation of what CSV entails.

Areas of Agreement / Disagreement

Participants express differing views on the effectiveness of searching for SVD code online, with some advocating for it while others find it insufficient. There is no consensus on a specific method or code for performing SVD in Excel.

Contextual Notes

Participants note the potential need for code adaptation and the limitations of online resources, which may not provide universally applicable solutions for all matrix sizes.

Adel Makram
Messages
632
Reaction score
15
I have a matrix of data and I want to do SVD using excel, is it possible?
 
Computer science news on Phys.org
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.
 
So how to write the code for SVD in excel for mn matrix?
 
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.
 
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   Reactions: S.G. Janssens
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.
 
So what do you expect, that others do google searches for you when you can do that as well?
 
  • Like
Likes   Reactions: S.G. Janssens
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.
 
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   Reactions: 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   Reactions: 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   Reactions: CalcNerd

Similar threads

  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
9
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K