{"id":50318,"date":"2024-08-13T22:23:06","date_gmt":"2024-08-13T20:23:06","guid":{"rendered":"https:\/\/blog.sheetgo.com\/?p=50318"},"modified":"2026-01-07T18:57:07","modified_gmt":"2026-01-07T17:57:07","slug":"usar-o-script-do-google-apps-no-google-sheets","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/google-sheets-features\/use-google-apps-script-in-google-sheets\/","title":{"rendered":"How to use Google Apps Script in Google Sheets? [2026 tutorial for beginners]"},"content":{"rendered":"\n[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; da_disable_devices=&#8221;off|off|off&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; da_is_popup=&#8221;off&#8221; da_exit_intent=&#8221;off&#8221; da_has_close=&#8221;on&#8221; da_alt_close=&#8221;off&#8221; da_dark_close=&#8221;off&#8221; da_not_modal=&#8221;on&#8221; da_is_singular=&#8221;off&#8221; da_with_loader=&#8221;off&#8221; da_has_shadow=&#8221;on&#8221;][et_pb_row _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">This article will teach you how to use Google Apps Script in Google Sheets. We will share script examples and how they affect spreadsheets. We will also explain some key concepts like Custom Functions and Data Types.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s get right into it!<\/span><\/p>\n<p><b>Key Takeaways:<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In Google Sheets, Apps Script can be used to automate data entry, generate reports, and clean and format data, among other things.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To use Google Apps Script in Google Sheets, go to <\/span><b>Extension &gt; Apps Script<\/b><span style=\"font-weight: 400;\"> and type or paste your code.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Key concepts in Apps Script include Custom functions, Triggers, Properties and Methods, Apps Script Services, Error Handling, and Libraries.<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_id=&#8221;what&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>What is Google Apps Script?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Google Apps Script is a cloud-based platform that lets you create your own programs to work with your Google apps (like Gmail, Docs, and Sheets). These programs perform tasks automatically. They can send emails or organize data. They can also add new features to your apps, like custom menus or buttons.<\/span><b><\/b><\/p>\n<p><span style=\"font-weight: 400;\">Google Apps Script uses a simple programming language called JavaScript. You don&#8217;t need to be an expert coder to write it, though.<\/span><b><\/b><\/p>\n<p><span style=\"font-weight: 400;\">In simple terms, this is how Google Apps Scripts works:<\/span><b><\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You write simple instructions (code) in the Apps Script editor.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Google&#8217;s servers read your instructions and perform the tasks you want.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The results appear in your Google apps. These results could be new menus, automated tasks, or custom apps.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Now, how to use Apps Script in Google Sheets?<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_1.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_1&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text module_id=&#8221;how&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>How to use Google Apps Script in Google Sheets?<\/b><\/h2>\n<ol>\n<li><span style=\"font-weight: 400;\"> Open your Google Sheet.<\/span><\/li>\n<li><span style=\"font-weight: 400;\"> Click on \u201c<\/span><b>Extensions<\/b><span style=\"font-weight: 400;\">\u201c in the menu bar and select \u201c<\/span><b>Apps Script<\/b><span style=\"font-weight: 400;\">\u201d. This will open a new tab with the Apps Script editor.<\/span><\/li>\n<\/ol>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_2.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_2&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">3. You will see Code.gs. This is the main file where you&#8217;ll write your JavaScript code. It\u2019s located in the \u201cEditor\u201d menu.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_3.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_3&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">4. Type in or paste your code. You might need to learn Javascript to know how to write code, or you <\/span><a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/how-to-generate-google-sheets-formulas-with-ai\/\"><span style=\"font-weight: 400;\">can generate code with Gemini or ChatGPT<\/span><\/a><span style=\"font-weight: 400;\">. But here is the script we\u2019ll use for this tutorial:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;]function sendEmails() {\nconst sheet = SpreadsheetApp.getActiveSheet();\nconst data = sheet.getDataRange().getValues(); \/\/ Get all data\nconst headers = data.shift(); \/\/ Remove and store headers\nfor (let i = 1; i &lt; data.length; i++) {\nconst row = data[i];\nconst emailAddress = row[headers.indexOf(&#8220;Email&#8221;)]; \/\/ Get email from column\nconst subject = &#8220;Automated Email&#8221;; \/\/ Customize subject\nconst message = `Hello ${row[headers.indexOf(&#8220;Name&#8221;)]}, this is an automated email from Google Sheets.`; \/\/ Customize message\nif (emailAddress) { \/\/ Check if email exists\nMailApp.sendEmail({\nto: emailAddress,\nsubject: subject,\nbody: message\n});\n}\n}\n}[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_4.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_4&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">What\u2019s the scenario behind this script? Let\u2019s assume we have a contact list in a Google Sheet and want to use it for a basic email campaign. The script will fetch all the necessary data, such as email and name, to compose and send emails.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_5.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_5&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">5. Click the \u201c<\/span><b>Save<\/b><span style=\"font-weight: 400;\">\u201d icon to save the script. <\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_6.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_6&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">6. In the top left corner, rename your project and click \u201c<\/span><b>Run<\/b><span style=\"font-weight: 400;\">.\u201d The script will send emails to all addresses in your sheet.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_7.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_7&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">7. Apps Script scripts require authorization to access your Google Sheets data. You&#8217;ll be prompted to grant these permissions when you run a script.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_8.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_8&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">8. You can also set up a trigger to run the script automatically on a schedule (e.g., daily or weekly). To do that, hover over your mouse on the left icons and click \u201c<\/span><b>Triggers<\/b><span style=\"font-weight: 400;\">.\u201d<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_9.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_9&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">9. Click the \u201c<\/span><b>+ Add Trigger<\/b><span style=\"font-weight: 400;\">\u201d button.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_10.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_10&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">10. Go to event source and choose &#8220;<\/span><b>Time-driven<\/b><span style=\"font-weight: 400;\">.&#8221;<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_11.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_11&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">11. Select a time-based type.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_12.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_12&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Specific date and time:<\/b><span style=\"font-weight: 400;\"> For a one-time trigger.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Minutes timer:<\/b><span style=\"font-weight: 400;\"> To run at a specified interval in minutes (e.g., every 15 minutes).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Hour timer:<\/b><span style=\"font-weight: 400;\"> To run at a specified interval in hours (e.g., every 3 hours).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Day timer:<\/b><span style=\"font-weight: 400;\"> To run daily at a specific time.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Week timer:<\/b><span style=\"font-weight: 400;\"> To run on specific days of the week at a specific time.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Month timer:<\/b><span style=\"font-weight: 400;\"> To run on specific days of the month at a specific time.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">12. Click &#8220;<\/span><b>Save<\/b><span style=\"font-weight: 400;\">.&#8221; The trigger is now active.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_13.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_13&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">Here is the email I received after running the script.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_14.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_14&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">There you go! You now know how to use Google Apps Script in Google Sheets. But let\u2019s discuss more use cases and see how Apps Script enhances spreadsheets.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><\/span><\/p>[\/et_pb_text][et_pb_text module_id=&#8221;practical&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>Practical examples of Apps Scripts in action<\/b><\/h2>\n<h3><b>1. Automate data entry<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">You can use Google Apps Scripts in Google Sheets to automate data entry.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Manual data entry is prone to typos. With <\/span><a href=\"https:\/\/www.sheetgo.com\/blog\/how-to-solve-with-sheetgo\/google-sheets-automations\/\"><span style=\"font-weight: 400;\">automation<\/span><\/a><span style=\"font-weight: 400;\">, you reduce the chances of human mistakes. Apps Script can pull data from other sources (like websites, forms, or emails) and automatically plug it into your spreadsheet.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s say you get emailed receipts for business expenses. Apps Script can scan those emails, extract the relevant numbers (date, amount, category), and neatly organize them in your expense tracker spreadsheet.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s write and explain a script:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;]function extractExpensesFromEmails() {\n\n\/\/ 1. Get Unread Emails with Receipts\nvar label = GmailApp.getUserLabelByName(&#8220;Receipts&#8221;); \/\/ Change &#8220;Receipts&#8221; if your label is different\nvar threads = label.getThreads(0, 5); \/\/ Get the first 5 unread threads\n\n\/\/ 2. Process Each Email\nfor (var i = 0; i &lt; threads.length; i++) {\nvar messages = threads[i].getMessages();\nfor (var j = 0; j &lt; messages.length; j++) {\nvar message = messages[j];\n\n\/\/ 3. Extract Expense Details (This is a simplified example)\nvar body = message.getBody();\nvar amountMatch = body.match(\/\\$\\d+\\.\\d{2}\/);\u00a0 \/\/ Look for $ amounts\nvar dateMatch = body.match(\/\\d{2}\\\/\\d{2}\\\/\\d{4}\/); \/\/ Look for MM\/DD\/YYYY dates\n\n\/\/ 4. If found, add to Spreadsheet\nif (amountMatch &amp;&amp; dateMatch) {\nvar amount = amountMatch[0];\nvar date = dateMatch[0];\nvar sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();\nsheet.appendRow([date, amount, message.getSubject()]); \/\/ Adjust columns as needed\n}\n}\n\n\/\/ 5. Mark Email as Read\nthreads[i].markRead();\n}\n}[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_15.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_15&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h4><b>What does this script mean?<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">We assume you have a Gmail label called &#8220;Receipts&#8221; where you store expense emails. The script fetches the first 5 unread threads (conversations) from that label. It loops through each thread and its individual messages (emails).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It then extracts expense details. Keep in mind that we&#8217;ve highly simplified this part. The script assumes a specific format for expenses in the email body (e.g., &#8220;$15.99&#8221; and &#8220;07\/25\/2024&#8221;).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Then, if the script finds both the amount and date, it gets the active spreadsheet and adds a new row with the extracted data (and the email subject for reference).<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_16.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_16&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">Finally, after processing, the script marks the email thread as read to avoid duplicates.<\/span><\/p>\n<p><b>Note:<\/b><span style=\"font-weight: 400;\"> Our script is simplified. The accuracy of the data depends entirely on the email format and the script&#8217;s ability to parse it correctly. Moreover, you might have additional columns in your actual expense tracker (e.g., category, payment method).<\/span><\/p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>2. Generate Reports<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">You can also use Google Apps Script in Google Sheets to generate reports.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Think about those tedious reports you have to make\u2014maybe sales summaries, project updates, or student grades. Apps Script can take the pain out of this process by pulling that data from a Google Sheet or other places.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s say you track your weekly sales in a Google Sheet. Apps Script can:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Grab the latest sales numbers from your sheet.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Calculate total sales, sales by product, and maybe even growth compared to last week.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Make a <\/span><a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-features\/how-to-make-a-pie-chart-in-google-sheets\/\"><span style=\"font-weight: 400;\">pie chart<\/span><\/a><span style=\"font-weight: 400;\"> or <\/span><a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-features\/how-to-make-a-line-graph-in-google-sheets\/\"><span style=\"font-weight: 400;\">line graph<\/span><\/a><span style=\"font-weight: 400;\"> report and a summary.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Email the report to your manager every Monday morning.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">You set it up once, and then Google Apps Script does the rest \u2013 week after week!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here is a script example, and we will explain it below.<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">function generateSalesReport() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Get the sales data<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&#8220;WeeklySales&#8221;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var data = sheet.getDataRange().getValues();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Calculate total sales and sales by product<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var totalSales = 0;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var salesByProduct = {};<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0for (var i = 1; i &lt; data.length; i++) { \/\/ Skip header row<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0var product = data[i][1];<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0var sales = data[i][2];<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0totalSales += sales;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0salesByProduct[product] = (salesByProduct[product] || 0) + sales;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Create the report<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var report = &#8220;&lt;h2&gt;Weekly Sales Report&lt;\/h2&gt;\\n\\n&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0report += &#8220;&lt;p&gt;Total Sales: $&#8221; + totalSales.toFixed(2) + &#8220;&lt;\/p&gt;\\n\\n&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0report += &#8220;&lt;h3&gt;Sales by Product:&lt;\/h3&gt;\\n\\n&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0for (var product in salesByProduct) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0report += &#8220;&lt;p&gt;&#8221; + product + &#8220;: $&#8221; + salesByProduct[product].toFixed(2) + &#8220;&lt;\/p&gt;\\n\\n&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Send the email<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var emailSubject = &#8220;Weekly Sales Report&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var emailBody = report;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0MailApp.sendEmail(&#8220;YOUR_EMAIL_ADDRESS&#8221;, emailSubject, &#8220;&#8221;, {htmlBody: emailBody}); \/\/ Include your email address<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_17.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_17&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><b>Recommended reading:<\/b> <a href=\"https:\/\/www.sheetgo.com\/blog\/sales-processes\/google-sheets-sales-templates\/\"><span style=\"font-weight: 400;\">Top 5 Google Sheets sales templates<\/span><\/a><\/p>\n<h4><b>What does this script mean?<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">The script fetches all the values from the &#8220;WeeklySales&#8221; sheet. It loops through the data and calculates total sales and sales per product. It then creates an HTML report with the calculated data. Finally, the script uses MailApp.sendEmail to send the report as an email.<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">MailApp.sendEmail<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">Here is a Google Sheet grouping all sales:<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_18.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_18&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">Here is what the total weekly sales report looks like in the email:<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_19.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_19&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.27.4&#8243; _module_preset=&#8221;default&#8221; hover_enabled=&#8221;0&#8243; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221; sticky_enabled=&#8221;0&#8243;]<p><b>Note:<\/b><span style=\"font-weight: 400;\"> This is a simplified script. Change &#8220;WeeklySales&#8221; if your sheet has a different name. Replace &#8220;YOUR_EMAIL_ADDRESS&#8221; with the actual recipient\u2019s email address.<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>3. Clean and format data<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Cleaning and formatting data is another way to use Apps Scripts in Google Sheets.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Imagine you have a messy spreadsheet filled with customer information. Maybe some names have extra spaces, dates are in different formats, or some cells have typos. Cleaning this up manually would be a real headache. This is where Apps Scripts come in to save the day.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can use Google Apps Scripts to scan your data and find and fix specific issues, such as:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Extra spaces:<\/b><span style=\"font-weight: 400;\"> Automatically remove extra spaces before and after names.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Incorrect formats:<\/b><span style=\"font-weight: 400;\"> Change dates from &#8220;29\/07\/2024&#8221; to &#8220;July 29, 2024&#8221; so everything matches.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Typos:<\/b><span style=\"font-weight: 400;\"> If a product name is misspelled, the script can fix it.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">You can also use Google Apps Scripts to organize information and combine or split data.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s create a Javascript for this example.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Imagine you have a Google Sheet with customer orders. Each row has information like Order ID, Customer Name, Product, Quantity, and Order Date. You want to organize the orders by date, with the most recent orders at the top.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Our script could be something like this:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">function sortSheetByDate() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var range = sheet.getRange(&#8220;A2:E26&#8221;); \/\/ Adjust the range to cover your data<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Get the data<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var data = range.getValues();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Check if dates are in Date object format and convert them to strings<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0data.forEach(function(row) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0if (Object.prototype.toString.call(row[4]) === &#8216;[object Date]&#8217;) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0row[4] = Utilities.formatDate(row[4], SpreadsheetApp.getActiveSpreadsheet().getSpreadsheetTimeZone(), &#8216;dd\/MM\/yyyy&#8217;);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0});<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Parse the dates correctly and sort<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0data.sort(function(a, b) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0var dateA = new Date(a[4].split(&#8216;\/&#8217;).reverse().join(&#8216;-&#8216;));<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0var dateB = new Date(b[4].split(&#8216;\/&#8217;).reverse().join(&#8216;-&#8216;));<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0return dateB &#8211; dateA; \/\/ Sort from newest to oldest<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0});<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\/\/ Set the sorted data back to the sheet<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0range.setValues(data);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_20.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_20&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h4><b>What does this script mean?<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">The script finds the order of information you want to sort. It then carefully takes all the information from each order form \u2013 customer name, order date, etc. \u2013 and puts it into separate cells. This is where the magic happens! The script looks at each order date and finds which orders are newer and which are older.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Data with dates not in chronological order:<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_21.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_21&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">Data with dates in chronological order after using the script:<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_22.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_22&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text module_id=&#8221;essential&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>Essential Apps Script concepts to know and use in Google Sheets<\/b><\/h2>\n<h3><b>1. Custom functions<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Custom functions allow you to create your own functions that you can use directly in Google Sheets, just like the built-in functions (<\/span><a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/sumif-google-sheets\/\"><span style=\"font-weight: 400;\">SUM<\/span><\/a><span style=\"font-weight: 400;\">, <\/span><a href=\"https:\/\/www.sheetgo.com\/blog\/google-sheets-formulas\/averageifs-formula-google-sheets\/\"><span style=\"font-weight: 400;\">AVERAGE<\/span><\/a><span style=\"font-weight: 400;\">, etc.). These <\/span><a href=\"https:\/\/www.sheetgo.com\/blog\/excel-features\/100-functions-formulas-for-google-sheets-excel-basics\/\"><span style=\"font-weight: 400;\">functions<\/span><\/a><span style=\"font-weight: 400;\"> are written in JavaScript within Apps Script and can perform various tasks, from simple calculations to complex data manipulations.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here is an example of a custom function:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">function DOUBLE(input) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0return input * 2;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">This custom function doubles numbers in a cell. After adding the custom function to the Script Editor, go back to your spreadsheet.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s say cell A1 contains the number 580.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Type =DOUBLE(A1) in cell B1.<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">=DOUBLE(A1)<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Google Sheets runs your function, giving it the value 1160 in cell B1.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The function calculates 580 * 2 = 1160.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Cell B1 displays the result: 1160.<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_23.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_23&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h4><b>Difference between a custom function and a general code you write in the Google Apps Script<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">The main difference between a custom function and any other code lies in how you use and call them within Google Sheets.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A custom function code <\/span><b>must return a value<\/b><span style=\"font-weight: 400;\">, like:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">return input * 2;.<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">A function cannot modify any part of the spreadsheet or trigger any other actions. It can only compute and return a result based on its inputs.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Moreover, to use a custom function, you must enter the =functionName() code <\/span><b>into a cell<\/b><span style=\"font-weight: 400;\"> on the spreadsheet, like:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">\u00a0=DOUBLE(A1) <\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>2. Triggers<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">You also need to learn about triggers if you want to use Google Apps Script in Google Sheets.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Imagine you have a task in Google Sheets that should happen automatically, without you having to click any buttons. That&#8217;s where triggers come in!\u00a0 A trigger is like a little alarm clock you set up within your Apps Script code. It tells your script to wake up and run a specific part of your code when a particular event happens in your spreadsheet.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can customize triggers to run your script when a sheet is opened, a cell is edited, a form is submitted, or even on a specific date and time.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_24.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_24&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">You can also use triggers to keep your data fresh. For example, a trigger could automatically pull in the latest stock prices or weather information.\u00a0<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>3. Properties and Methods<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Properties and methods let you change how Google Sheets works. You can write scripts that automatically format cells or move data around. For example, instead of manually changing the color of hundreds of cells, your script can do it instantly.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Think of properties like the traits or attributes of an object. In Google Sheets, this could be:<\/span><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">The background color of a cell:<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">cell.getBackground()<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<ul>\n<li><span style=\"font-weight: 400;\">The value inside a cell:<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">cell.getValue()<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<ul>\n<li><span style=\"font-weight: 400;\">The font size of the text:<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">\u00a0cell.getFontSize()<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">You can find out a property&#8217;s current value or set it to change its appearance or behavior.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Methods, however, are like the verbs or actions that an object can perform. For example, a cell in Google Sheets can:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Change its contents:<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">cell.setValue(&#8220;Hello!&#8221;)<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<ul>\n<li><span style=\"font-weight: 400;\">Clear itself completely:<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">cell.clearContent()<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<ul>\n<li><span style=\"font-weight: 400;\">Merge with neighboring cells:<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">cell.mergeAcross()<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">You &#8220;call&#8221; a method to make it happen. It&#8217;s like giving an instruction.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here is a simple script example:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">function formatImportantCells() {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var sheet = SpreadsheetApp.getActiveSheet();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var range = sheet.getRange(&#8220;A1:B10&#8221;); \/\/ Get a group of cells<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var cells = range.getCells(); \/\/ Get individual cells<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0for (var i = 0; i &lt; cells.length; i++) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0if (cells[i].getValue() &gt; 100) { \/\/ Check the value<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0cells[i].setBackground(&#8220;yellow&#8221;); \/\/ Set a property (color)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_25.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_25&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">This script checks the values in cells A1 through B10. If a value is greater than 100, the script turns the cell&#8217;s background yellow.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In short:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Properties describe:<\/b><span style=\"font-weight: 400;\"> They tell you about the current state of things.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Methods do:<\/b><span style=\"font-weight: 400;\"> They make things happen.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Dot notation:<\/b><span style=\"font-weight: 400;\"> You use a dot to access properties and methods (e.g., cell.getValue()).<\/span><\/li>\n<\/ul>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">cell.getValue()<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>4. Data types<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Data types are another concept you need to learn to use Google Apps Script in Google Sheets.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Data types are labels that tell Apps Script what kind of information it&#8217;s dealing with. Just like you&#8217;d distinguish between apples and oranges, Apps Script needs to know if it&#8217;s working with numbers, text, dates, or other types.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But why do data types matter in Google Sheets?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are at least three reasons:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Correct Calculations:<\/b><span style=\"font-weight: 400;\"> Imagine you&#8217;re adding up expenses. If Apps Script thinks your numbers are actually text, you&#8217;ll get weird results. Data types guarantee calculations happen accurately.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Proper Formatting:<\/b><span style=\"font-weight: 400;\"> You want your dates to look like dates and your phone numbers to behave like phone numbers. Data types help you control how things are displayed and used in your spreadsheet.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Error Prevention:<\/b><span style=\"font-weight: 400;\"> If you try to use a date as if it were a number, Apps Script might flag an error. Knowing the right data types helps you avoid these hiccups and write code that runs smoothly.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Let&#8217;s say you&#8217;re tracking sales and have a column in Google Sheets with the number of items sold. When you use Apps Script to calculate total sales, it needs to understand this column contains numbers, not just random characters.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">For instance, the script below mentions the data type:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">if (valueType === &#8220;number&#8221;) {<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">Here&#8217;s the breakdown:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">valueType: This variable stores the result of typeof value. The typeof operator is a JavaScript feature that directly tells you the data type of a variable.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">=== &#8220;number&#8221;: This comparison checks if the valueType is strictly equal to the string &#8220;number&#8221;. If it is, the script knows it&#8217;s dealing with a numerical value and proceeds to add it to the totalSales.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">We\u2019ve just covered a few Apps Scripts concepts or terms. There are more, though, such as Apps Script Services, Error Handling, and Libraries.<\/span><\/p>[\/et_pb_text][et_pb_text module_id=&#8221;tips&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>Tips and best practices for Apps Script<\/b><\/h2>\n<h3><b>1. Learn Javascript<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Learning JavaScript gives you a solid foundation for understanding how Google Apps Script works. It becomes way easier to figure out code you find online, troubleshoot your own projects, and write more advanced scripts.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Once you&#8217;ve grasped the basics of JavaScript, you&#8217;ll manipulate data in really clever ways and interact with other services on the web.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Moreover, JavaScript is a widely used language, so your new skills won&#8217;t go to waste. You can apply them to other projects beyond Google Apps Script. For instance, you can build simple websites or even work on complex web development projects.<\/span><\/p>\n<h3><b>2. Write efficient and maintainable code<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Your code is like a recipe, and a good recipe is:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Efficient:<\/b><span style=\"font-weight: 400;\"> It doesn&#8217;t waste ingredients or time. Efficient code runs faster and uses less of your Apps Script quota (the limit on how much your scripts can do).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Maintainable:<\/b><span style=\"font-weight: 400;\"> It&#8217;s easy to understand and update later. Maintainable code saves you headaches when you need to make changes down the road.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Here are a few additional tips for Google Apps Script:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Don&#8217;t name your variables &#8220;x&#8221; or &#8220;temp.&#8221; Choose names that describe what they store. For example, instead of &#8220;data,&#8221; use &#8220;customerNames&#8221; or &#8220;orderDates.&#8221;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Break your code into smaller, reusable functions. Each function should ideally perform one specific task. This will make your code more organized and easier to test.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Things don&#8217;t always go as planned. Use \u201ctry&#8230;catch\u201d blocks to gracefully catch errors, which prevents your script from crashing unexpectedly.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">If you find yourself writing the same code multiple times, create a function for it. This principle is called &#8220;Don&#8217;t Repeat Yourself&#8221; (DRY).<\/span><\/li>\n<\/ol>\n<h3><b>3. Debug smartly<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">In Google Apps Script, bugs are errors or unexpected behavior in your code. Debugging is the process of finding and correcting these issues.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When Apps Script encounters a problem, it usually displays an error message. This message is your first clue. It often tells you what went wrong. You\u2019ll know if you used a variable that doesn&#8217;t exist, divided by zero, or something else. You\u2019ll also know where it went wrong, like the line of code causing trouble.<\/span><\/p>[\/et_pb_text][et_pb_image src=&#8221;https:\/\/static.sheetgo.com\/wp-content\/uploads\/2024\/08\/google_apps_scripts_google_sheets_26.webp&#8221; title_text=&#8221;google_apps_scripts_google_sheets_26&#8243; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][\/et_pb_image][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">Apps Script has a built-in debugger. It&#8217;s like a more powerful version of \u201cconsole.log().\u201d You can pause your code, step through it line by line, and inspect variables in real time.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s say you have this code:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">function calculateArea(length, width) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0var area = length * width;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0console.log(&#8220;The area is: &#8221; + area);\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">calculateArea(10,); \/\/ Notice the missing argument for width<\/span><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">You run it, and it crashes with an error: &#8220;TypeError: Cannot read property &#8216;*&#8217; of undefined.&#8221; What&#8217;s happening?<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Read the error:<\/b><span style=\"font-weight: 400;\"> It says you&#8217;re trying to use the &#8216;*&#8217; (multiplication) operator on something undefined.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Check the code:<\/b><span style=\"font-weight: 400;\"> You realize you forgot to pass a value for the \u201cwidth\u201d argument.<\/span><\/li>\n<\/ol>\n<p><b>Fix the error:<\/b><span style=\"font-weight: 400;\"> Change the last line to:<\/span><\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><span style=\"font-weight: 400;\">calculateArea(10, 5);<\/span><\/p>[\/et_pb_text][et_pb_text module_id=&#8221;use&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>Use Google Apps Scripts to enhance your Google Sheets<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Congratulations! You&#8217;ve just unlocked the power of Apps Script within Google Sheets. In this article, we saw some practical use cases and shared script examples. You are now fully equipped to use Google Apps Script in Google Sheets.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">By automating tasks, customizing functions, and even building interactive web applications, you&#8217;re well on your way to becoming a spreadsheet ninja. Keep learning, keep scripting, and keep pushing the boundaries of what&#8217;s possible in Google Sheets.<\/span><\/p>[\/et_pb_text][et_pb_text module_id=&#8221;faq&#8221; _builder_version=&#8221;4.24.1&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h2><b>FAQ<\/b><\/h2>\n<p><b>How to add Script Editor to Google Sheets?<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The Script Editor is built into Google Sheets. You don&#8217;t need to add it separately.<\/span><\/p>\n<p><b>How to open the Script Editor in Google Sheets?<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Go to Extensions &gt; Apps Script. This will open the Script Editor in a new tab.<\/span><\/p>\n<p><b>Where is the Script Editor in Google Sheets?<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The Script Editor is not physically located within your Google Sheet. It opens in a separate tab or window when accessed through the Extensions menu. Go to Extensions &gt; Apps Script.<\/span><\/p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]\n","protected":false},"excerpt":{"rendered":"<p>This article will teach you how to use Google Apps Script in Google Sheets. We will share script examples and how they affect spreadsheets. We will also explain some key concepts like Custom Functions and Data Types. Let\u2019s get right into it! Key Takeaways: In Google Sheets, Apps Script can be used to automate data [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":44470,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[37],"tags":[39,28],"class_list":["post-50318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-features","tag-connections-t","tag-spreadsheets"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/50318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=50318"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/50318\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/44470"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=50318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=50318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=50318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}