Google Sheets: How to Write a Custom Function
Suppose you are an American living in a foreign country, and you have no understanding of the metric system. You want to write a function to convert Celsius to Fahrenheit. Proceed as follows to write a function for this conversion in Google Sheets.
1.Create a sheet in Google Docs. Select Tools>Script Editor.
3.Then, the empty Code Editor will be shown.
4.Now, write and save your function. For this example, the function is saved under the name ctof, as in Celcius to Farenheit. Below is the code to convert from Celcius to Fahrenheit.
5.If you click the arrow on the toolbar to run the function, Google Sheets will first ask you if you want to save it.
6.You can give it any name.
7.Now, Google is asking for permissions to run.
8.Here is the screen where you give it permission.
9.Now, you are done. You can reference the function ctof in your spreadsheet just like any other function.
Follow the reactions below and share your own thoughts.