Skip to content

Instantly share code, notes, and snippets.

@ShellyShulei
Created December 11, 2019 16:04
Show Gist options
  • Select an option

  • Save ShellyShulei/152816d3fa05c5fff9ac4a951f1d8a3d to your computer and use it in GitHub Desktop.

Select an option

Save ShellyShulei/152816d3fa05c5fff9ac4a951f1d8a3d to your computer and use it in GitHub Desktop.
Calculates the volume of a sphere.
name: Function
description: Calculates the volume of a sphere.
host: EXCEL
api_set: {}
script:
content: |
/**
* Calculates the volume of a sphere.
* @customfunction
* @param {number} radius
* @returns The volume of the sphere.
*/
function volume(radius) {
return (Math.pow(radius, 3) * 4 * Math.PI) / 3;
}
language: typescript
libraries: |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js
core-js@2.4.1/client/core.min.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment