MATLAB provides integration with Excel that allows MATLAB functions to be called from spreadsheet formulas. I wanted similar functionality using GNU Octave, so I created an Excel add-in that starts Octave and allows Octave functions to be called directly from worksheet cells.

The add-in provides Excel functions that communicate with a running Octave process and return the result back to the spreadsheet. Calculations are handled synchronously, so Excel waits for the Octave calculation to complete before continuing.

Example formulas

After installing the add-in, formulas such as these can be entered directly into Excel cells:

=OCTAVEADDINVERSION()
=OCTAVEVERSION()
=OCTAVEFN("airy",0,0)

OCTAVEADDINVERSION() returns the installed add-in version, OCTAVEVERSION() returns the version of GNU Octave being used, and OCTAVEFN() can be used to call an Octave function and return its result to Excel.

Installation

The add-in is intended for Microsoft Excel on Windows and requires GNU Octave to already be installed on the computer.

  1. Install GNU Octave if it is not already installed.
  2. Download and extract the Octave Excel Add-in package.
  3. Close all running Excel windows before installing the add-in.
  4. Open PowerShell in the extracted directory and run:
.\install.ps1

The installation script installs and registers the add-in for Excel. After it completes, reopen Excel and test the installation with:

=OCTAVEADDINVERSION()
=OCTAVEVERSION()

If both formulas return version information, the add-in is installed and communicating with Octave correctly. You can then use OCTAVEFN() to call Octave functions from worksheet cells.

Excel should be completely closed when installing or updating the add-in. If the installer reports that Excel is running, close all Excel windows and run install.ps1 again.

Why I built it

I use Excel for working with and presenting numerical data, but I wanted the ability to use Octave for calculations without having to manually move values between Excel and Octave. This add-in provides a fairly simple bridge between the two.

The downloads below include the packaged add-in and related files needed to install it.