Meta tags:
description= Create custom functions in Google Apps Script and use them in Google Sheets like built-in functions.;
Headings (most frequently used words):
the, script, custom, function, quickstart, stay, organized, with, collections, save, and, categorize, content, based, on, your, preferences, page, summary, objectives, prerequisites, set, up, run, next, steps, google, workspace, for, developers, tools, connect,
Text of the page (most frequently used words):
#google (50), the (42), script (27), apps (26), price (11), #workspace (10), sheets (10), function (10), custom (9), console (8), thumb (8), and (8), with (8), discount (8), cloud (7), support (7), for (7), samples (7), sale (7), developer (6), code (6), spreadsheet (6), you (6), from (6), create (6), blog (5), admin (5), down (5), content (5), send (5), drive (5), español (4), products (4), youtube (4), overview (4), developers (4), your (4), need (4), feedback (4), extend (4), functions (4), following (4), resources (4), input (4), new (4), chat (4), calendar (4), manage (3), all (3), twitter (3), newsletter (3), apis (3), explorer (3), dashboard (3), tools (3), release (3), notes (3), under (3), more (3), this (3), how (3), that (3), enter (3), cell (3), saleprice (3), run (3), formatted (3), dollars (3), then (3), use (3), sample (3), quickstart (3), calculate (3), home (3), codelabs (3), get (3), share (3), forms (3), gmail (3), sign (3), 한국어 (2), 日本語 (2), ภาษาไทย (2), বাংলা (2), हिंदी (2), فارسی (2), العربيّة (2), עברית (2), русский (2), türkçe (2), tiếng (2), việt (2), português (2), brasil (2), polski (2), italiano (2), indonesia (2), français (2), américa (2), latina (2), deutsch (2), english (2), terms (2), platform (2), tutorials (2), other (2), too (2), steps (2), last (2), updated (2), 2026 (2), utc (2), page (2), licensed (2), see (2), license (2), parameter (2), represents (2), might (2), 100 (2), format (2), dollarus (2), return (2), usd (2), currency (2), let (2), number (2), param (2), value (2), calculates (2), editor (2), save (2), set (2), prerequisites (2), discounted (2), items (2), can (2), previews (2), updates (2), started (2), training (2), card (2), builder (2), marketplace (2), add (2), ons (2), automate (2), vault (2), tasks (2), slides (2), sites (2), meet (2), keep (2), docs (2), classroom (2), search (2), data (2), multiple (2), employees (2), agent (2), using (2), api (2), generate (2), reference (2), guides (2), cookies, privacy, firebase, chrome, android, connect, service, watch, videos, explore, our, copy, them, build, own, ask, question, tag, stack, overflow, read, easy, understand, easytounderstand, solved, problem, solvedmyproblem, otherup, missing, information, missingtheinformationineed, complicated, many, toocomplicatedtoomanysteps, out, date, outofdate, issue, samplescodeissue, otherdown, tell, except, otherwise, noted, are, details, java, registered, trademark, oracle, its, affiliates, site, policies, apache, creative, commons, attribution, menus, continue, learning, about, next, formula, runs, created, previous, section, results, first, original, second, percentage, location, uses, decimal, commas, instead, switch, back, style, numberformat, intl, customfunction, such, apply, given, delete, any, paste, click, within, select, menu, item, extensions, web, browser, access, internet, account, accounts, require, administrator, approval, objectives, creates, write, just, like, built, process, involves, setting, running, demonstrates, creating, used, outlined_flag, summary, categorize, based, preferences, stay, organized, collections, fundamentals, upload, files, track, video, views, comments, summarize, hires, personalized, appreciation, certificates, curated, remotely, respond, record, time, activities, populate, team, vacation, plan, travels, accessible, across, projects, employee, equipment, requests, make, agenda, meetings, import, csv, stock, drop, alerts, pdfs, fact, check, statements, adk, gemini, model, tournament, bracket, sessions, conference, offsite, mail, merge, analyze, sentiment, natural, language, collect, review, timesheets, driving, distance, convert, meters, miles, tiered, pricing, aggregate, documents, libraries, text, vertex, automation, quickstarts, skip, main,
Text of the page (random words):
custom function quickstart apps script google for developers skip to main content google workspace home apps script all products google workspace apps admin console cloud search gmail google calendar google chat google classroom google docs google drive google forms google keep google meet google sheets google sites google slides google tasks google vault extend automate share add ons apps script chat apps drive apps marketplace resources tools admin console apps script dashboard google cloud console apis explorer card builder training support how to get started codelabs developer support updates release notes developer previews youtube newsletter x twitter blog english deutsch español español américa latina français indonesia italiano polski português brasil tiếng việt türkçe русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 简体 中文 繁體 日本語 한국어 sign in apps script overview guides reference samples support google workspace home apps script overview guides reference samples support all products more resources more overview quickstarts automation custom functions generate text with vertex ai libraries tutorials aggregate content from multiple documents calculate a tiered pricing discount calculate driving distance convert meters to miles collect review timesheets from employees analyze feedback sentiment using the google cloud natural language api create a mail merge with gmail sheets create a sign up for an offsite create a sign up for sessions at a conference create a tournament bracket fact check statements with an adk ai agent and gemini model generate send pdfs from sheets get stock price drop alerts import csv data to a spreadsheet make an agenda for meetings manage new employee equipment requests manage projects using the apps script api plan travels with an ai agent accessible across google workspace populate a team vacation calendar record time activities in calendar sheets respond to feedback run apps script functions remotely send curated content send personalized appreciation certificates to employees share resources with new hires summarize data from multiple sheets track youtube video views comments upload files to drive from forms codelabs apps script fundamentals google workspace apps admin console cloud search gmail google calendar google chat google classroom google docs google drive google forms google keep google meet google sheets google sites google slides google tasks google vault extend automate share add ons apps script chat apps drive apps marketplace tools admin console apps script dashboard google cloud console apis explorer card builder training support how to get started codelabs developer support updates release notes developer previews youtube newsletter x twitter blog home google workspace apps script samples send feedback custom function quickstart stay organized with collections save and categorize content based on your preferences page summary outlined_flag google apps script can be used to create custom functions for google sheets this sample demonstrates creating a custom function to calculate and format the sale price of discounted items in us dollars the process involves setting up the script in the apps script editor and then running the function in a spreadsheet cell you can use google apps script to write a custom function then use it in google sheets just like a built in function the following quickstart sample creates a custom function that calculates the sale price of discounted items the sale price is formatted as us dollars objectives set up the script run the script prerequisites to use this sample you need the following prerequisites a google account google workspace accounts might require administrator approval a web browser with access to the internet set up the script create a new spreadsheet from within your new spreadsheet select the menu item extensions apps script delete any code in the script editor and paste in the following code then click save calculates the sale price of a value at a given discount the sale price is formatted as us dollars param number input the value to discount param number discount the discount to apply such as 5 or 50 return the sale price formatted as usd customfunction function saleprice input discount let price input input discount let dollarus intl numberformat en us style currency currency usd return dollarus format price run the script switch back to your spreadsheet in a cell enter saleprice 100 20 the first parameter represents the original price and the second parameter represents the discount percentage if you re in a location that uses decimal commas you might need to enter saleprice 100 20 instead the formula that you enter in the cell runs the function in the script you created in the previous section the function results in a sale price of 80 00 next steps to continue learning about how to extend sheets with apps script see the following resources spreadsheet custom functions custom menus in google workspace extend sheets send feedback except as otherwise noted the content of this page is licensed under the creative commons attribution 4 0 license and code samples are licensed under the apache 2 0 license for details see the google developers site policies java is a registered trademark of oracle and or its affiliates last updated 2026 04 20 utc need to tell us more easy to understand easytounderstand thumb up solved my problem solvedmyproblem thumb up other otherup thumb up missing the information i need missingtheinformationineed thumb down too complicated too many steps toocomplicatedtoomanysteps thumb down out of date outofdate thumb down samples code issue samplescodeissue thumb down other otherdown thumb down last updated 2026 04 20 utc blog read the google workspace developers blog stack overflow ask a question under the google apps script tag code samples explore our code samples or copy them to build your own videos watch apps script tutorials google workspace for developers platform overview developer products release notes developer support terms of service tools admin console apps script dashboard google cloud console apis explorer connect blog newsletter x twitter youtube android chrome firebase google cloud platform google ai all products terms privacy manage cookies english deutsch español español américa latina français indonesia italiano polski português brasil tiếng việt türkçe русский עברית العربيّة فارسی हिंदी বাংলা ภาษาไทย 中文 简体 中文 繁體 日本語 한국어
|