{"id":209,"date":"2017-11-06T00:00:00","date_gmt":"2017-11-06T08:00:00","guid":{"rendered":"http:\/\/officedevblogs.wpengine.com\/?p=209"},"modified":"2017-11-06T00:00:00","modified_gmt":"2017-11-06T08:00:00","slug":"custom-functions-in-excel-developer-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/custom-functions-in-excel-developer-preview\/","title":{"rendered":"Custom Functions in Excel: Developer Preview"},"content":{"rendered":"<div id=\"body-content\">\n<p>I&#8217;m thrilled to announce that you can try writing custom functions in JavaScript starting today.<\/p>\n<p>Custom functions (similar to &#8220;user-defined functions&#8221;\u009d, or &#8220;UDFs&#8221;\u009d) are JavaScript functions that you can build as part of your add-in. Users can see and run those functions in Excel alongside built-in functions like =SUM or =VLOOKUP. The best part is that those same functions will work everywhere add-ins do: on your PC, Mac, and iPad, and even in Excel Online. But for now the Developer Preview is only available on Windows.<\/p>\n<p>Here&#8217;s what it looks like in action:<\/p>\n<p><img decoding=\"async\" width=\"583\" height=\"385\" alt=\"Custom Function GIF\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2018\/05\/customfunction.gif\"><\/p>\n<p><p>And here&#8217;s the code I wrote for this simple function:<\/p>\n<pre style=\"padding-left: 30px\">function add42(num1, num2) {<br>\treturn num1 + num2 + 42;<br>}<\/pre>\n<p>We&#8217;ve had tons of requests from developers who want to use custom functions for all kinds of reasons. Here are a few ideas:<\/p>\n<ul>\n<li>Calculate math operations, like whether a number is prime<\/li>\n<li>Fetch info from the web, like a bank account balance<\/li>\n<li>Stream live data, like a stock price<\/li>\n<\/ul>\n<p>Get all the details and try custom functions for yourself at <a href=\"http:\/\/aka.ms\/customfunctions\">aka.ms\/customfunctions<\/a>.<\/p>\n<p>We&#8217;re hard at work on lots of improvements for the current preview so that custom functions will be even more powerful when we ship officially. So we hope you&#8217;ll give us as much feedback as possible: post suggestions to the <a href=\"https:\/\/officespdev.uservoice.com\/forums\/224641-feature-requests-and-feedback\/category\/163563-add-in-excel\">Excel Add-ins UserVoice page<\/a> and tag Stack Overflow questions with the <a href=\"https:\/\/stackoverflow.com\/questions\/tagged\/custom-functions-excel\">custom-functions-excel tag<\/a>.<\/p>\n<p>Happy coding!<\/p>\n<p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m thrilled to announce that you can try writing custom functions in JavaScript starting today.<\/p>\n","protected":false},"author":69076,"featured_media":210,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[18],"class_list":["post-209","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-add-ins","tag-excel"],"acf":[],"blog_post_summary":"<p>I&#8217;m thrilled to announce that you can try writing custom functions in JavaScript starting today.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/69076"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/210"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}