Learn how to use custom functions in Excel (similar to user-defined functions, or UDFs). Custom functions are JavaScript functions that you can add to Excel, and then use them like any native Excel function (for example =Sum). This sample accompanies the Custom Functions Overview topic.
- Oct 27, 2017: Initial version.
- Install Office 2016 for Windows and join the Office Insider program. You must have Office build number 8711 or later.
Follow these instructions to use this custom function sample add-in:
- Publish the code files (HTML, JavaScript) in the same folder on a website.
- Replace
https://<INSERT-URL-HERE>
in the manifest file (there should be 3 occurrences) with the URL of your website. - Sideload the manifest using the instructions found at https://aka.ms/sideload-addins.
- Test your custom function by entering
=Contoso.ADD42(1,2)
in a cell. - If you make changes to the sample add-in, copy the updated files to your website, and then close and reopen Excel. If your functions are not available in Excel, re-insert the add-in using Insert > My Add-ins.
- Follow @OfficeDev on Twitter for updates and send feedback to [email protected].
We'd love to get your feedback about this sample. You can send your feedback to us in the Issues section of this repository.
Questions about Microsoft Office 365 development in general should be posted to Stack Overflow. If your question is about the Office JavaScript APIs, make sure that your questions are tagged with [office-js] and [API].
- Office add-in documentation
- Office Dev Center
- More Office Add-in samples at OfficeDev on Github
This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
Copyright (c) 2017 Microsoft Corporation. All rights reserved.