NAG and Microsoft Excel - Expand your capabilities
Learn how to maximize Excel's potential with the NAG Library
One of the major benefits of the NAG Library is its inherent flexibility; it can be used by programmers developing in traditional languages, or by users of modern software packages and programming environments, like Microsoft Excel.
To make using the NAG Library easy, we provide the Library as a Dynamic Link Library (DLL). Despite the relatively simple methods of linking to the Library from Excel, it's important to note that to gain benefit from NAG routines in this manner you'll need to be capable of programming in either Microsoft Visual Basic for Applications (VBA) or Visual Studio for Office (VSTO).
The 'NAG and Microsoft Excel' area of the NAG website has been created as a central repository for those wishing to either:
- Learn about linking NAG functionality to Excel via the NAG Dynamic Link Libraries
- Read white papers and technical reports on using NAG in Excel
- Open, view and experiment with NAG routine examples from within Excel
- Leave feedback for NAG's technical team on your experiences on using NAG in Excel and / or suggest future development ideas
Interactive demonstrations highlighting NAG in Excel functions showing ease of application development for both beginners and more experienced programmers:
Basic examples:
- How to calculate multivariate probability
- How to find a zero of a function using a reverse communication interface
- How to compute the option price given by the Black-Scholes-Merton formula together with its Greeks
- How to compute the option price given by Heston's stochastic volatility model together with its Greeks (NEW AT MARK 23)
- How to solve a Markowitz Modern Portfolio optimization problem
Advanced examples:
- How to compute the Nearest Correlation Matrix (NCM), with bounds on the eigenvalues, and how to find eigenvalues for both symmetric and asymmetric matrices (NEW AT MARK 23)
- How to compute the Nearest Correlation Matrix (NCM) with the k-factor structure, and how to find eigenvalues for both symmetric and asymmetric matrices (NEW AT MARK 23)
- How to find the global optimum of a multivariate function using multi-level coordinate search algorithm
- How to solve a nonlinear least-squares problem using the sequential quadratic programming (SQP) method (NEW EXAMPLE)
- How to obtain Kaplan-Meier estimates for censored data
- How to perform GARCH time series identification, estimation and forecasting
- How to perform ARIMA time series identification, estimation and forecasting
If you wish use the any of these examples you need to have the appropriate NAG Library installed. All examples are 32/64 bit compatible. The table below shows NAG Product codes depending on which version of Excel and which type of NAG Library you use.
| NAG Fortran Library for Windows | NAG C Library for Windows | |
| 32-bit Excel | FLDLL234ML | CLW3209DAL |
| 64-bit Excel | FLW6I23DCL | CLW6I09DAL |
To access a trial of these libraries please go to our download page. To run the demonstrations effectively you must have macros enabled in Excel. We suggest you save the file (using right click 'Save As') and then open from the saved location. Before you run a demonstration please refer to the Help and Information buttons within the Excel workbook, where available.The examples are supplied with the appropriate VB headers. If you would like to call other routines from the NAG Library, please download the headers via the hyperlinks listed at the bottom of this page (where applicable, otherwise please contact support).
Additional examples of calling NAG routines from Excel are available for most of the above libraries. For the C Library, these examples are available for download for both CLW3209DAL and CLW6I09DAL. For FLDLL234ML and FLW6I23DCL, once the library has been downloaded and installed, the examples can be found in the Samples/Excel_Examples subdirectory of the library installation directory.
Recorded web demonstrations highlighting NAG in Excel functions show the ease of application development.
- Portfolio Optimization Example (using the NAG library from Excel)
- Option Pricing Example (using the NAG library from Excel)
Please click here to view recorded webinar clips highlighting NAG in Excel functions.
White Paper/Technical Reports
NAG Experts and collaborators working at other organisations and learning institutions have written papers and reports about using NAG routines in Excel. Links to various reports are featured below.
- Using the NAG Library to calculate financial option prices in Excel
- Sample Microsoft Excel Projects Illustrating How to Call the NAG C Library
- NAG DLLs and Microsoft Excel and Microsoft Visual Basic for Applications
- How to call NAG functions with Microsoft Access and Excel data
- A step by step guide to using the NAG Fortran Library with Microsoft Excel 2003
- Tech Tip: Calling NAG Routines from Excel
Header files for the NAG Libraries
Visual Basic NAG header files (for use in VBA)
- Header files for 32-bit NAG Fortran Library FLDLL234ML
- Header files for 64-bit NAG Fortran Library FLW6I23DCL
- Header files for 32-bit NAG C Library CLW3209DAL
- Header files for 64-bit NAG C Library CLW6I09DAL
Visual Basic .NET NAG header files (for use in VSTO)
- Header files for 32-bit NAG Fortran Library FLDLL234ML
- Header files for 64-bit NAG Fortran Library FLW6I23DCL
- Header files for 32-bit NAG C Library CLW3209DAL
- Header files for 64-bit NAG C Library CLW6I09DAL
Not found what you're looking for?
If you'd like to talk to us about your requirements for mathematical and statistical functionality to enhance your use of programming using Excel either email us at nagmarketing@nag.co.uk or call us directly.