Skip to content

Latest commit

 

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XlCalcNet

XlCalcNet (Microsoft EXcel addin for Calculations in multiprecision, based on PythonNet) is a python library that focusses on numerical calculations in multiple precision and data visualisation, which can also be used within spreadsheet formulas.

The full manual is available online in HTML format: XlCalcNet.html.

The manual can also be downloaded in PDF format from here.

XlCalcNet can be installed as a python package from PyPI. More detailed information regarding the installation and general usage of XlCalcNet can be found here.

Since one of the main goals of XlCalcNet is to enable the use of functions written in Python or C# within spreadsheet formulas, it is assumed that Microsoft Excel (2010 or later, 64 bit) is installed on the users system, running under Windows (7.1 or later, 64 bit), with .NET Framework 4.8/4.8.1 installed.

Use with Microsoft Excel

Once MS Excel has been prepared for using XlCalcNet (see here for details), one can call small Python scripts in spreadsheet formulas and pass parameters from other spreadsheet cells. If the example workbook “Simple.xlsx” has been loaded, the following dialog box will appear when the user clicks on the “Insert Function” button in Excel’s formula bar:

Excel's function dialog

XlCalcNet can also be used for procedures. To access the relevant dialog, right-click anywhere on the spreadsheet. The following context menu will appear:

Excel's context menu

Click on Navigator for XlCalcNet. The following dialog box will appear:

Navigator for XlCalcNet

This can be used to call external procedures, which are not used in spreadsheet formulas. The procedures can be used to generate plots, for example. The generated plots can be saved as bitmap files or as interactive 3D plots in a separate window.

Additional information

Since the main goal is to give access to software written in Python (or, via PythonNet, software written in C#) within Microsoft Excel spreadsheet formulas, a dedicated CPython installation is strongly recommended, to make it easier to configure the interaction with Microsoft Excel, without disturbing existing Python installations.

The interaction with Microsoft Excel is achieved by running a socket server written in Python, which is called from spreadsheet formulas using the functionality provided by ExcelDna.

On the Python side XlCalcNet includes (a slightly patched version of) Mpmath 4.0 to provide a rich set of functions in arbitrary precision, using not only Mpmath's binary floating point and interval data types, but also Python's built-in Decimal and Fraction data types. If gmpy2 is installed, its data types can be used in many cases instead of Mpmath's binary data types, being much faster. Likewise, if python-flint is installed, its data types can be used in many cases instead of Mpmath's interval data types, being much faster, and sometimes more accurate.

Also included in XlCalcNet is (a slightly patched version of) of S3Dlib, a Python library for visualizing 3D surfaces and lines which is used in conjunction with the Matplotlib library.

On the Pascal/C/C++ side, XlCalcNet uses DAMath, Boost Math, Boost Multiprecision, Boost Odeint and Eigen to provide numerical functions in single, double, extended, quadruple and octuple precision, which are available to the user both from C# and Python.

The XlCalcNet2 library, which is licensed under the LGPL-3.0 and is therefore provided in a separate repository, is based on Boost Math, Boost Multiprecision, Boost Odeint, Eigen, GMP, MPFR, MPC and FLINT and provides functions for the same data types as XlCalcNet and also in arbitrary precision, which are available to the user both from C# and Python.

XlCalcNet is intended to be used together with existing Python libraries like NumPy (described in the manual here), Matplotlib (described in the manual here), Pandas (described in the manual here), SciPy (described in the manual here).

About

Python/C# numerical library for use within spreadsheet formulas (MS Excel)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages