# Machine learning toolkit for Excel

Do you know of any machine learning add-ins that I could use within Excel? For example I would like to be able to select a range of data and use that for training purposes and then use another sheet for getting the results of different learning algorithms.

• Are there any specific reasons to do the analysis inside Excel? Maybe exporting the data to a data science tool is more appropriate. – Amir Ali Akbari Jan 27 '15 at 16:04
• I basically have Excel spreadsheets where we do a lot of our analysis and fed up of exporting the data to other tools. I just want to do the analysis in Excel. – Dimitris Jan 27 '15 at 16:21
• Mathematica has some machine learning algorithms and can read Excel spreadsheets directly. – image_doctor Jan 27 '15 at 17:38
• If you really want to use an Excel add-in, the XLMiner package is a solid option, although expensive: solver.com/xlminer-data-mining – Paul Jan 28 '15 at 19:02
• Take a look at bettersheet.com This product allows you to do machine learning directly in Excel – Matt Bolds Jun 28 '17 at 0:46

As far as I know, currently there are not that many projects and products that allow you to perform serious machine learning (ML) work from within Excel.

However, the situation seems to be changing rapidly due to active Microsoft's efforts in popularizing its ML cloud platform Azure ML (along with ML Studio). The recent acquisition of R-focused company Revolution Analytics by Microsoft (which appears to me as more of acqui-hiring to a large extent) is an example of the company's aggressive data science market strategy.

In regard to ML toolkits for Excel, as a confirmation that we should expect most Excel-enabled ML projects and products to be Azure ML-focused, consider the following two projects (the latter is an open source):

• That's what I was asking for. – Dimitris Jan 28 '15 at 10:39
• @Dimitris: You're welcome. Glad that you like my answer. – Aleksandr Blekh Jan 28 '15 at 11:03

(Most) Machine Learning algorithms are essentially optimization problems where you minimize/maximize an objective function subject to certain constraints. Excel comes with the Solver add-in which is pretty handy for lightweight problems, so it is entirely possible for you to build a Machine Learning model within Excel! (I've done it myself)

If your data size is reasonably small (say <10k rows and not too many columns), it is in fact pretty quick and easy to build certain ML models within Excel. All you need is to learn how to use the Excel Solver, and the built-in matrix functions for vectorized computations.

For example, Neural Networks and Logistic Regressions are particularly easy to build due to the simplicity of their objective function. If you are really inclined to try you could refer to the following link: http://www.xlpert.com/ebook/Build_Neural_Network_With_MS_Excel_sample.pdf

Now, Excel does has major limitations. There are numerical stability issues, it is tricky to write loops (without VBA), it is a pain to write lengthy functions in Excel and there's no concept of structure so I wouldn't try to build things like Random Forest. That being said, there is still a good amount of algorithms you can implement with Excel for fun.

Of course, for serious analysis, I would still recommend you to use proper tools for that.

First of all, let me tell you that Excel shouldn't be used for machine learning or any data analysis complicated enough that you wouldn't be comfortable doing it on paper. Why? Here is a list of resources to tell you why:

Now, if you really really want to do heavy calculations without exporting your data, I suggest using xlwings. Basically, this allows two-way communication between Excel and Python. Watch the video in the homepage for a quick introduction. In this way, you would be able to use numpy, pandas and scikit-learn (or other machine learning library that you may prefer) without exporting your data first.

• I work with many clients who do a lot of their work in Excel. You can mess up your R scripts like you can mess up in Matlab or anything else. I totally disagree. – Dimitris Jan 28 '15 at 9:55
• The fact that other people do it doesn't mean it is the right to thing to do. It is not about messing up because as you said, it is quite possible to make mistakes in R or Python. However, the difference is that you are more likely to mess up in Excel than in other tools more suitable to analytics, statistics or machine learning. I added some more links in case you need convincing. – Robert Smith Jan 28 '15 at 16:57
• I have been using and customising Excel for all sorts of things for the last 15 years. I am sure you can produce 100 links discussing how bad it can be but from personal experience I know you can control it and use all its capabilities without messing up anything. Visual programming which is what Excel offers is a brilliant concept. Just because something is trendy like Python at the moment doesn't necessarily mean is the best option. – Dimitris Jan 28 '15 at 17:08
• And how do you know you're not messing up anything? People make mistakes precisely because they are not easy to spot. Again, this happens in all sorts of environments, but it is more likely in Excel. However, if you want to keep using Excel for heavy calculations, go ahead. – Robert Smith Jan 28 '15 at 18:18
• I know I am not messing up anything because I design the entire thing and have control. So far I haven't had any difficult situation in Excel. I guess Microsoft Research looking into using Excel Add-ins says something to you. – Dimitris Jan 28 '15 at 19:20

Nobody does serious machine learning in Excel; that's not what it's for. Fortunately, you can directly import Excel files into better platforms like python. In particular, there's a great package called pandas, which makes work very pleasant. Here's a demo.

• I guess you haven't had the experience I had with a lot of my clients working in Excel. "Nobody does serious ML in Excel", really??? That's the best you can do? – Dimitris Jan 28 '15 at 9:56
• If you want to make your work difficult, be my guest :) Once I was asked to deliver an ML presentation at a company that used Excel. They liked the content but were initially taken aback by the software. Well, I had better things to do than try to craft a silk purse out of a sow's ear. Give pandas a try; you'll quickly come to like it. – Emre Jan 28 '15 at 15:12
• I have worked with Pandas and I regularly use R however I cannot dismiss Excel simply because there is a perception out there that its old, cumbersome and must go. I think there is a lot you can do with it and our clients rely on it. – Dimitris Jan 28 '15 at 16:52

Weka can import CSV files, and allows you to choose which columns and rows you want to use in your analysis. It's not an "add-in" for Excel per-se, but it might work for you.

You can find an Excel and VBA implementation of Random Forest using the open source ALGLIB Library here

• Your library is hidden behind a log-in, what's the name of it? – Mast Sep 6 '20 at 10:24
• No log-in required. – purbani Sep 7 '20 at 11:12
• Yes, there is. Academia.edu requires a log-in if you haven't logged-in there already. Perhaps you're already logged in with a Google account by default, that works too. But you need to log-in one way or another. – Mast Sep 7 '20 at 11:14

Vortarus Technologies LLC here also have an Excel Add-In that can do various intermediate ML tasks from SVM to Neural Nets to CART etc. The free trial is open ended but has some function limits.

You should take a look at this link.