<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Erkan Erkişi on Medium]]></title>
        <description><![CDATA[Stories by Erkan Erkişi on Medium]]></description>
        <link>https://medium.com/@erkanerkisi?source=rss-8ace05a98bea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lRH_2EPYaH5Y4q8geFbeGA.jpeg</url>
            <title>Stories by Erkan Erkişi on Medium</title>
            <link>https://medium.com/@erkanerkisi?source=rss-8ace05a98bea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:40:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@erkanerkisi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating Google Sheets with Google Calendar Using Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/integrating-google-sheets-with-google-calendar-using-google-apps-script-d8ddcc425365?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8ddcc425365</guid>
            <category><![CDATA[google-apps-script]]></category>
            <category><![CDATA[google-sheets-api]]></category>
            <category><![CDATA[google-sheets-script]]></category>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[app-script]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 17:02:39 GMT</pubDate>
            <atom:updated>2024-07-16T17:02:39.332Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our Google Apps Script series! So far, we’ve covered a range of topics including custom functions, creating custom menus and dialogs, integrating external APIs, automating data analysis, building interactive dashboards, advanced data manipulation, creating custom add-ons, and integrating with Google Drive. In this article, we’ll explore how to integrate Google Sheets with Google Calendar using Google Apps Script. This integration can help you automate calendar management tasks, streamline event scheduling, and improve productivity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ap4GcDpsA48ZI6RZcwbsuQ.png" /></figure><h3>Why Integrate Google Sheets with Google Calendar?</h3><p>Integrating Google Sheets with Google Calendar can help you:</p><ul><li>Automate calendar management tasks such as creating, updating, and deleting events.</li><li>Streamline event scheduling by linking data in Google Sheets with Google Calendar.</li><li>Improve productivity by automating repetitive tasks and reducing manual effort.</li></ul><h3>Getting Started with Google Calendar Integration</h3><p>To demonstrate how to integrate Google Sheets with Google Calendar, we’ll create a script that performs the following tasks:</p><ol><li>Create a new calendar event.</li><li>Update an existing calendar event.</li><li>Delete a calendar event.</li><li>List calendar events within a specific date range and display them in Google Sheets.</li></ol><h3>Step 1: Open the Google Apps Script Editor</h3><ol><li>Open Google Sheets and navigate to Extensions &gt; Apps Script to open the script editor.</li></ol><h3>Step 2: Write the Script for Google Calendar Integration</h3><p>Replace the existing code in the script editor with the following script:</p><pre>function createCalendarEvent(eventTitle, eventDate, eventTime, eventDuration) {<br>  var calendar = CalendarApp.getDefaultCalendar();<br>  var startTime = new Date(eventDate + &#39;T&#39; + eventTime);<br>  var endTime = new Date(startTime.getTime() + eventDuration * 60 * 60 * 1000);<br>  var event = calendar.createEvent(eventTitle, startTime, endTime);<br>  Logger.log(&#39;Event ID: &#39; + event.getId());<br>  return event.getId();<br>}<br><br>function updateCalendarEvent(eventId, newTitle, newDate, newTime, newDuration) {<br>  var calendar = CalendarApp.getDefaultCalendar();<br>  var event = calendar.getEventById(eventId);<br>  if (event) {<br>    var newStartTime = new Date(newDate + &#39;T&#39; + newTime);<br>    var newEndTime = new Date(newStartTime.getTime() + newDuration * 60 * 60 * 1000);<br>    event.setTitle(newTitle);<br>    event.setTime(newStartTime, newEndTime);<br>    Logger.log(&#39;Event updated: &#39; + event.getId());<br>  } else {<br>    Logger.log(&#39;Event not found: &#39; + eventId);<br>  }<br>}<br>function deleteCalendarEvent(eventId) {<br>  var calendar = CalendarApp.getDefaultCalendar();<br>  var event = calendar.getEventById(eventId);<br>  if (event) {<br>    event.deleteEvent();<br>    Logger.log(&#39;Event deleted: &#39; + event.getId());<br>  } else {<br>    Logger.log(&#39;Event not found: &#39; + eventId);<br>  }<br>}<br>function listCalendarEvents(startDate, endDate) {<br>  var calendar = CalendarApp.getDefaultCalendar();<br>  var start = new Date(startDate);<br>  var end = new Date(endDate);<br>  var events = calendar.getEvents(start, end);<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  <br>  sheet.clear();<br>  sheet.appendRow([&#39;Event Title&#39;, &#39;Start Time&#39;, &#39;End Time&#39;, &#39;Event ID&#39;]);<br>  <br>  events.forEach(function(event) {<br>    sheet.appendRow([event.getTitle(), event.getStartTime(), event.getEndTime(), event.getId()]);<br>  });<br>}</pre><h3>Step 3: Create a Custom Menu</h3><p>Add a custom menu to your Google Sheet to easily run the functions from the script editor. Add the following code to the script editor:</p><pre>function onOpen() {<br>  var ui = SpreadsheetApp.getUi();<br>  ui.createMenu(&#39;Calendar Integration&#39;)<br>    .addItem(&#39;Create Event&#39;, &#39;promptCreateEvent&#39;)<br>    .addItem(&#39;Update Event&#39;, &#39;promptUpdateEvent&#39;)<br>    .addItem(&#39;Delete Event&#39;, &#39;promptDeleteEvent&#39;)<br>    .addItem(&#39;List Events&#39;, &#39;promptListEvents&#39;)<br>    .addToUi();<br>}<br><br>function promptCreateEvent() {<br>  var ui = SpreadsheetApp.getUi();<br>  var titleResponse = ui.prompt(&#39;Enter Event Title:&#39;);<br>  var dateResponse = ui.prompt(&#39;Enter Event Date (YYYY-MM-DD):&#39;);<br>  var timeResponse = ui.prompt(&#39;Enter Event Time (HH:MM):&#39;);<br>  var durationResponse = ui.prompt(&#39;Enter Event Duration (hours):&#39;);<br>  <br>  if (titleResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      dateResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      timeResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      durationResponse.getSelectedButton() == ui.Button.OK) {<br>    var title = titleResponse.getResponseText();<br>    var date = dateResponse.getResponseText();<br>    var time = timeResponse.getResponseText();<br>    var duration = parseFloat(durationResponse.getResponseText());<br>    var eventId = createCalendarEvent(title, date, time, duration);<br>    ui.alert(&#39;Event created with ID: &#39; + eventId);<br>  }<br>}<br><br>function promptUpdateEvent() {<br>  var ui = SpreadsheetApp.getUi();<br>  var idResponse = ui.prompt(&#39;Enter Event ID:&#39;);<br>  var titleResponse = ui.prompt(&#39;Enter New Event Title:&#39;);<br>  var dateResponse = ui.prompt(&#39;Enter New Event Date (YYYY-MM-DD):&#39;);<br>  var timeResponse = ui.prompt(&#39;Enter New Event Time (HH:MM):&#39;);<br>  var durationResponse = ui.prompt(&#39;Enter New Event Duration (hours):&#39;);<br>  <br>  if (idResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      titleResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      dateResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      timeResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      durationResponse.getSelectedButton() == ui.Button.OK) {<br>    var eventId = idResponse.getResponseText();<br>    var newTitle = titleResponse.getResponseText();<br>    var newDate = dateResponse.getResponseText();<br>    var newTime = timeResponse.getResponseText();<br>    var newDuration = parseFloat(durationResponse.getResponseText());<br>    updateCalendarEvent(eventId, newTitle, newDate, newTime, newDuration);<br>    ui.alert(&#39;Event updated: &#39; + eventId);<br>  }<br>}<br><br>function promptDeleteEvent() {<br>  var ui = SpreadsheetApp.getUi();<br>  var idResponse = ui.prompt(&#39;Enter Event ID:&#39;);<br>  <br>  if (idResponse.getSelectedButton() == ui.Button.OK) {<br>    var eventId = idResponse.getResponseText();<br>    deleteCalendarEvent(eventId);<br>    ui.alert(&#39;Event deleted: &#39; + eventId);<br>  }<br>}<br><br>function promptListEvents() {<br>  var ui = SpreadsheetApp.getUi();<br>  var startResponse = ui.prompt(&#39;Enter Start Date (YYYY-MM-DD):&#39;);<br>  var endResponse = ui.prompt(&#39;Enter End Date (YYYY-MM-DD):&#39;);<br>  <br>  if (startResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      endResponse.getSelectedButton() == ui.Button.OK) {<br>    var startDate = startResponse.getResponseText();<br>    var endDate = endResponse.getResponseText();<br>    listCalendarEvents(startDate, endDate);<br>    ui.alert(&#39;Events listed in the sheet.&#39;);<br>  }<br>}</pre><h3>Step 4: Test Your Script</h3><ol><li>Save all your files and return to Google Sheets.</li><li>Reload the Google Sheet to see the new “Calendar Integration” menu.</li><li>Use the menu to create, update, delete, and list calendar events.</li></ol><h3>Benefits of Google Calendar Integration</h3><ol><li>Automated Calendar Management: Create, update, and delete calendar events automatically.</li><li>Streamlined Scheduling: Link data in Google Sheets with Google Calendar to streamline scheduling.</li><li>Improved Productivity: Automate repetitive tasks and reduce manual effort.</li></ol><h3>Next Steps</h3><p>Integrating Google Sheets with Google Calendar using Google Apps Script can significantly enhance your calendar management and scheduling capabilities. In future articles, we will explore more advanced integration techniques and how to connect with other Google Workspace tools.</p><p>Stay tuned for more articles in this series, and soon you’ll be able to transform your Google Sheets into powerful, integrated tools tailored to your specific needs.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8ddcc425365" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Google Sheets with Google Drive Using Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/integrating-google-sheets-with-google-drive-using-google-apps-script-0442bd4d3106?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/0442bd4d3106</guid>
            <category><![CDATA[google-sheet-api]]></category>
            <category><![CDATA[google-apps-script]]></category>
            <category><![CDATA[google-sheets-script]]></category>
            <category><![CDATA[app-script]]></category>
            <category><![CDATA[google-sheets]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 17:02:23 GMT</pubDate>
            <atom:updated>2024-07-14T17:02:23.705Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our Google Apps Script series! So far, we’ve covered a wide range of topics including custom functions, creating custom menus and dialogs, integrating external APIs, automating data analysis, building interactive dashboards, advanced data manipulation, and creating custom add-ons. In this article, we’ll explore how to integrate Google Sheets with Google Drive using Google Apps Script. This integration can help you automate file management tasks, streamline workflows, and improve productivity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ap4GcDpsA48ZI6RZcwbsuQ.png" /></figure><h3>Why Integrate Google Sheets with Google Drive?</h3><p>Integrating Google Sheets with Google Drive can help you:</p><ul><li>Automate file management tasks such as creating, renaming, and organizing files and folders.</li><li>Streamline workflows by linking data in Google Sheets with files in Google Drive.</li><li>Improve productivity by automating repetitive tasks and reducing manual effort.</li></ul><h3>Getting Started with Google Drive Integration</h3><p>To demonstrate how to integrate Google Sheets with Google Drive, we’ll create a script that performs the following tasks:</p><ol><li>Create a new folder in Google Drive.</li><li>Upload a file to the created folder.</li><li>Generate a list of files in a specific folder and display it in Google Sheets.</li></ol><h3>Step 1: Open the Google Apps Script Editor</h3><ol><li>Open Google Sheets and navigate to Extensions &gt; Apps Script to open the script editor.</li></ol><h3>Step 2: Write the Script for Google Drive Integration</h3><p>Replace the existing code in the script editor with the following script:</p><pre>function createFolder(folderName) {<br>  var folder = DriveApp.createFolder(folderName);<br>  Logger.log(&#39;Folder ID: &#39; + folder.getId());<br>  return folder.getId();<br>}<br><br>function uploadFileToFolder(folderId, fileName, fileContent) {<br>  var folder = DriveApp.getFolderById(folderId);<br>  var file = folder.createFile(fileName, fileContent);<br>  Logger.log(&#39;File ID: &#39; + file.getId());<br>  return file.getId();<br>}<br>function listFilesInFolder(folderId) {<br>  var folder = DriveApp.getFolderById(folderId);<br>  var files = folder.getFiles();<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  <br>  sheet.clear();<br>  sheet.appendRow([&#39;File Name&#39;, &#39;File ID&#39;]);<br>  <br>  while (files.hasNext()) {<br>    var file = files.next();<br>    sheet.appendRow([file.getName(), file.getId()]);<br>  }<br>}</pre><h3>Step 3: Create a Custom Menu</h3><p>Add a custom menu to your Google Sheet to easily run the functions from the script editor. Add the following code to the script editor:</p><pre>function onOpen() {<br>  var ui = SpreadsheetApp.getUi();<br>  ui.createMenu(&#39;Drive Integration&#39;)<br>    .addItem(&#39;Create Folder&#39;, &#39;promptCreateFolder&#39;)<br>    .addItem(&#39;Upload File&#39;, &#39;promptUploadFile&#39;)<br>    .addItem(&#39;List Files in Folder&#39;, &#39;promptListFilesInFolder&#39;)<br>    .addToUi();<br>}<br><br>function promptCreateFolder() {<br>  var ui = SpreadsheetApp.getUi();<br>  var response = ui.prompt(&#39;Enter Folder Name:&#39;);<br>  <br>  if (response.getSelectedButton() == ui.Button.OK) {<br>    var folderName = response.getResponseText();<br>    var folderId = createFolder(folderName);<br>    ui.alert(&#39;Folder created with ID: &#39; + folderId);<br>  }<br>}<br>function promptUploadFile() {<br>  var ui = SpreadsheetApp.getUi();<br>  var folderResponse = ui.prompt(&#39;Enter Folder ID:&#39;);<br>  var fileResponse = ui.prompt(&#39;Enter File Name:&#39;);<br>  var contentResponse = ui.prompt(&#39;Enter File Content:&#39;);<br>  <br>  if (folderResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      fileResponse.getSelectedButton() == ui.Button.OK &amp;&amp;<br>      contentResponse.getSelectedButton() == ui.Button.OK) {<br>    var folderId = folderResponse.getResponseText();<br>    var fileName = fileResponse.getResponseText();<br>    var fileContent = contentResponse.getResponseText();<br>    var fileId = uploadFileToFolder(folderId, fileName, fileContent);<br>    ui.alert(&#39;File uploaded with ID: &#39; + fileId);<br>  }<br>}<br>function promptListFilesInFolder() {<br>  var ui = SpreadsheetApp.getUi();<br>  var response = ui.prompt(&#39;Enter Folder ID:&#39;);<br>  <br>  if (response.getSelectedButton() == ui.Button.OK) {<br>    var folderId = response.getResponseText();<br>    listFilesInFolder(folderId);<br>    ui.alert(&#39;File list updated in the sheet.&#39;);<br>  }<br>}</pre><h3>Step 4: Test Your Script</h3><ol><li>Save all your files and return to Google Sheets.</li><li>Reload the Google Sheet to see the new “Drive Integration” menu.</li><li>Use the menu to create folders, upload files, and list files in a specific folder.</li></ol><h3>Benefits of Google Drive Integration</h3><ol><li>Automated File Management: Create, rename, and organize files and folders automatically.</li><li>Streamlined Workflows: Link data in Google Sheets with files in Google Drive to streamline workflows.</li><li>Improved Productivity: Automate repetitive tasks and reduce manual effort.</li></ol><h3>Next Steps</h3><p>Integrating Google Sheets with Google Drive using Google Apps Script can significantly enhance your file management and workflow automation capabilities. In future articles, we will explore more advanced integration techniques and how to connect with other Google Workspace tools.</p><p>Stay tuned for more articles in this series, and soon you’ll be able to transform your Google Sheets into powerful, integrated tools tailored to your specific needs.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0442bd4d3106" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Custom Add-ons for Google Sheets Using Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/creating-custom-add-ons-for-google-sheets-using-google-apps-script-2c6cc0e02801?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c6cc0e02801</guid>
            <category><![CDATA[google-apps-script]]></category>
            <category><![CDATA[app-script]]></category>
            <category><![CDATA[google-sheets-api]]></category>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[google-sheets-script]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Fri, 12 Jul 2024 17:03:55 GMT</pubDate>
            <atom:updated>2024-07-12T17:03:55.335Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our Google Apps Script series! So far, we’ve covered a range of topics including custom functions, creating custom menus and dialogs, integrating external APIs, automating data analysis, building interactive dashboards, and advanced data manipulation. In this article, we’ll explore how to create custom add-ons for Google Sheets using Google Apps Script. Custom add-ons can extend the functionality of Google Sheets, providing users with powerful tools and features tailored to their needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ap4GcDpsA48ZI6RZcwbsuQ.png" /></figure><h3>Why Create Custom Add-ons?</h3><p>Creating custom add-ons for Google Sheets can help you:</p><ul><li>Provide users with additional functionality not available in standard Google Sheets.</li><li>Automate repetitive tasks and improve efficiency.</li><li>Share custom tools and features with others.</li></ul><h3>Getting Started with Custom Add-ons</h3><p>To demonstrate how to create a custom add-on, we’ll build a simple add-on that allows users to quickly calculate summary statistics (e.g., mean, median, standard deviation) for a selected range of cells.</p><h3>Step 1: Open the Google Apps Script Editor</h3><ol><li>Open Google Sheets and navigate to Extensions &gt; Apps Script to open the script editor.</li></ol><h3>Step 2: Set Up the Project Manifest</h3><p>The project manifest file (appsscript.json) defines the configuration for your add-on. Replace the existing code in the manifest file with the following:</p><pre>{<br>  &quot;timeZone&quot;: &quot;America/New_York&quot;,<br>  &quot;dependencies&quot;: {},<br>  &quot;exceptionLogging&quot;: &quot;STACKDRIVER&quot;,<br>  &quot;oauthScopes&quot;: [<br>    &quot;https://www.googleapis.com/auth/spreadsheets.currentonly&quot;,<br>    &quot;https://www.googleapis.com/auth/script.container.ui&quot;<br>  ],<br>  &quot;runtimeVersion&quot;: &quot;V8&quot;,<br>  &quot;addOns&quot;: {<br>    &quot;common&quot;: {<br>      &quot;name&quot;: &quot;Summary Statistics&quot;,<br>      &quot;logoUrl&quot;: &quot;URL_TO_YOUR_LOGO&quot;,<br>      &quot;homepageTrigger&quot;: {<br>        &quot;runFunction&quot;: &quot;onOpen&quot;<br>      }<br>    },<br>    &quot;sheets&quot;: {<br>      &quot;homepageTrigger&quot;: {<br>        &quot;runFunction&quot;: &quot;showSidebar&quot;<br>      }<br>    }<br>  }<br>}</pre><p>Replace &quot;URL_TO_YOUR_LOGO&quot; with the URL of your logo image.</p><h3>Step 3: Write the Code for the Add-on</h3><p>Replace the existing code in the script editor with the following script:</p><pre>function onOpen() {<br>  var ui = SpreadsheetApp.getUi();<br>  ui.createAddonMenu()<br>    .addItem(&#39;Show Summary Statistics&#39;, &#39;showSidebar&#39;)<br>    .addToUi();<br>}<br><br>function showSidebar() {<br>  var html = HtmlService.createHtmlOutputFromFile(&#39;Sidebar&#39;)<br>      .setTitle(&#39;Summary Statistics&#39;)<br>      .setWidth(300);<br>  SpreadsheetApp.getUi().showSidebar(html);<br>}<br><br>function calculateStatistics(range) {<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  var data = sheet.getRange(range).getValues();<br>  var flatData = data.flat().filter(Number.isFinite);<br>  <br>  var mean = flatData.reduce((a, b) =&gt; a + b, 0) / flatData.length;<br>  var median = calculateMedian(flatData);<br>  var stdDev = calculateStdDev(flatData, mean);<br>  <br>  return {<br>    mean: mean,<br>    median: median,<br>    stdDev: stdDev<br>  };<br>}<br>function calculateMedian(values) {<br>  values.sort((a, b) =&gt; a - b);<br>  var half = Math.floor(values.length / 2);<br>  if (values.length % 2) {<br>    return values[half];<br>  } else {<br>    return (values[half - 1] + values[half]) / 2.0;<br>  }<br>}<br>function calculateStdDev(values, mean) {<br>  var squareDiffs = values.map(value =&gt; {<br>    var diff = value - mean;<br>    return diff * diff;<br>  });<br>  var avgSquareDiff = squareDiffs.reduce((a, b) =&gt; a + b, 0) / squareDiffs.length;<br>  return Math.sqrt(avgSquareDiff);<br>}</pre><h3>Step 4: Create the HTML File for the Sidebar</h3><p>Create a new HTML file in the script editor and name it Sidebar.html. Add the following code to the HTML file:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;base target=&quot;_top&quot;&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;h1&gt;Summary Statistics&lt;/h1&gt;<br>    &lt;p&gt;Select a range of cells and click &quot;Calculate&quot;.&lt;/p&gt;<br>    &lt;input type=&quot;text&quot; id=&quot;range&quot; placeholder=&quot;e.g., A1:A10&quot;&gt;<br>    &lt;button onclick=&quot;calculate()&quot;&gt;Calculate&lt;/button&gt;<br>    &lt;div id=&quot;results&quot;&gt;&lt;/div&gt;<br>    <br>    &lt;script&gt;<br>      function calculate() {<br>        var range = document.getElementById(&#39;range&#39;).value;<br>        google.script.run.withSuccessHandler(showResults).calculateStatistics(range);<br>      }<br>      <br>      function showResults(results) {<br>        var div = document.getElementById(&#39;results&#39;);<br>        div.innerHTML = `<br>          &lt;p&gt;Mean: ${results.mean}&lt;/p&gt;<br>          &lt;p&gt;Median: ${results.median}&lt;/p&gt;<br>          &lt;p&gt;Standard Deviation: ${results.stdDev}&lt;/p&gt;<br>        `;<br>      }<br>    &lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><h3>Step 5: Test Your Add-on</h3><ol><li>Save all your files and return to the Google Sheets.</li><li>Reload the Google Sheet to see the new “Summary Statistics” menu.</li><li>Click on Summary Statistics &gt; Show Summary Statistics to open the sidebar.</li><li>Enter a range of cells (e.g., A1:A10) and click &quot;Calculate&quot; to see the summary statistics.</li></ol><h3>Benefits of Custom Add-ons</h3><ol><li>Extended Functionality: Provide users with additional tools and features that are not available in standard Google Sheets.</li><li>Automation: Automate repetitive tasks and improve efficiency.</li><li>Customization: Create custom tools tailored to your specific needs and share them with others.</li></ol><h3>Next Steps</h3><p>Creating custom add-ons for Google Sheets using Google Apps Script can significantly enhance the functionality of Google Sheets and improve user experience. In future articles, we will explore more advanced add-on features and how to publish your add-on for others to use.</p><p>Stay tuned for more articles in this series, and soon you’ll be able to transform your Google Sheets into powerful, custom tools tailored to your specific needs.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c6cc0e02801" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Data Manipulation in Google Sheets with Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/advanced-data-manipulation-in-google-sheets-with-google-apps-script-45893723704d?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/45893723704d</guid>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[google-sheets-script]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[app-script]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Tue, 02 Jul 2024 07:01:27 GMT</pubDate>
            <atom:updated>2024-07-02T07:01:27.415Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our Google Apps Script series! So far, we’ve covered the basics, custom functions, creating custom menus and dialogs, integrating external APIs, automating data analysis, and building interactive dashboards. In this article, we’ll explore advanced data manipulation techniques in Google Sheets using Google Apps Script. These techniques will help you handle complex data transformations and improve your data processing capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWEcdoz2Bh73Il4qEE1Iww.png" /></figure><h3>Why Use Advanced Data Manipulation?</h3><p>Advanced data manipulation in Google Sheets can help you:</p><ul><li>Perform complex data transformations and calculations.</li><li>Automate data cleaning and formatting tasks.</li><li>Enhance your data analysis capabilities with custom scripts.</li></ul><h3>Getting Started with Advanced Data Manipulation</h3><p>To demonstrate advanced data manipulation, we’ll create a script that performs data cleaning, formatting, and transformation tasks on a sample dataset.</p><h3>Step 1: Prepare Your Data</h3><ol><li>Create a new Google Sheet and enter your sample data. Your data might look something like this:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sG_zD4gYq4ZvgI7TX59yfA.png" /></figure><h3>Step 2: Open the Script Editor</h3><ol><li>Navigate to Extensions &gt; Apps Script to open the script editor.</li></ol><h3>Step 3: Write the Script for Advanced Data Manipulation</h3><p>Replace the existing code in the script editor with the following script:</p><pre>function cleanAndFormatData() {<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  var data = sheet.getDataRange().getValues();<br>  <br>  // Remove duplicates<br>  var uniqueData = removeDuplicates(data);<br>  <br>  // Format dates and capitalize names<br>  var formattedData = uniqueData.map(function(row) {<br>    row[0] = formatDate(row[0]);<br>    row[3] = capitalizeName(row[3]);<br>    return row;<br>  });<br>  <br>  // Clear existing data and write formatted data<br>  sheet.clear();<br>  sheet.getRange(1, 1, formattedData.length, formattedData[0].length).setValues(formattedData);<br>}<br><br>function removeDuplicates(data) {<br>  var uniqueData = [];<br>  var seen = {};<br>  <br>  for (var i = 0; i &lt; data.length; i++) {<br>    var row = data[i];<br>    var key = row.join();<br>    <br>    if (!seen[key]) {<br>      uniqueData.push(row);<br>      seen[key] = true;<br>    }<br>  }<br>  <br>  return uniqueData;<br>}<br>function formatDate(date) {<br>  var d = new Date(date);<br>  return Utilities.formatDate(d, Session.getScriptTimeZone(), &#39;yyyy-MM-dd&#39;);<br>}<br>function capitalizeName(name) {<br>  return name.split(&#39; &#39;).map(function(word) {<br>    return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();<br>  }).join(&#39; &#39;);<br>}</pre><h3>Step 4: Set Up the Script Trigger</h3><p>To run this function automatically, set up a trigger:</p><ol><li>In the script editor, click on the clock icon (Triggers).</li><li>Click on + Add Trigger.</li><li>Set up a time-driven trigger to run cleanAndFormatData at your preferred frequency (e.g., daily, weekly).</li></ol><h3>Step 5: Test Your Script</h3><ol><li>Enter your sample data in the Google Sheet.</li><li>Run the cleanAndFormatData function manually by clicking the play button in the script editor.</li><li>Check the sheet to see the cleaned and formatted data.</li></ol><h3>Benefits of Advanced Data Manipulation</h3><ol><li>Complex Data Transformations: Perform advanced data transformations that are difficult to achieve with standard Google Sheets functions.</li><li>Automation: Automate data cleaning and formatting tasks, saving time and reducing manual effort.</li><li>Enhanced Analysis: Improve your data analysis capabilities with custom scripts tailored to your specific needs.</li></ol><h3>Next Steps</h3><p>Advanced data manipulation in Google Sheets using Google Apps Script can significantly enhance your data processing and analysis capabilities. In future articles, we will explore more advanced scripting techniques and how to integrate with other Google Workspace tools.</p><p>Stay tuned for more articles in this series, and soon you’ll be able to transform your Google Sheets into powerful, automated tools tailored to your specific needs.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45893723704d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Interactive Dashboards in Google Sheets with Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/building-interactive-dashboards-in-google-sheets-with-google-apps-script-1ce3561c6046?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ce3561c6046</guid>
            <category><![CDATA[google-sheets-script]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[app-script]]></category>
            <category><![CDATA[google-sheets]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Sun, 30 Jun 2024 11:16:55 GMT</pubDate>
            <atom:updated>2024-06-30T11:16:55.069Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our Google Apps Script series! So far, we’ve covered the basics, custom functions, creating custom menus and dialogs, integrating external APIs, and automating data analysis. In this article, we’ll explore how to build interactive dashboards in Google Sheets using Google Apps Script. Interactive dashboards can help you visualize data and make informed decisions quickly and effectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWEcdoz2Bh73Il4qEE1Iww.png" /></figure><h3>Why Build Interactive Dashboards?</h3><p>Interactive dashboards provide several benefits:</p><ul><li>Data Visualization: Transform raw data into insightful charts and graphs.</li><li>Interactivity: Allow users to interact with data through filters, buttons, and dynamic content.</li><li>Efficiency: Quickly analyze and interpret data without manual calculations.</li></ul><h3>Getting Started with Interactive Dashboards</h3><p>To demonstrate how to build an interactive dashboard, we’ll create a dashboard that visualizes sales data with charts and filters.</p><h3>Step 1: Prepare Your Data</h3><ol><li>Create a new Google Sheet and enter your sales data. Your data might look something like this:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fa2rY3ak2dkU2X8G4t_r7Q.png" /></figure><h3>Step 2: Open the Script Editor</h3><ol><li>Navigate to Extensions &gt; Apps Script to open the script editor.</li></ol><h3>Step 3: Write the Script to Create Interactive Elements</h3><p>Replace the existing code in the script editor with the following script:</p><pre>function onOpen() {<br>  var ui = SpreadsheetApp.getUi();<br>  ui.createMenu(&#39;Dashboard&#39;)<br>    .addItem(&#39;Update Chart&#39;, &#39;updateChart&#39;)<br>    .addToUi();<br>}<br><br>function updateChart() {<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  var chart = sheet.getCharts()[0];<br>  var range = sheet.getRange(&#39;A1:C10&#39;);<br>  chart = chart.modify()<br>    .addRange(range)<br>    .setOption(&#39;title&#39;, &#39;Sales Data&#39;)<br>    .setOption(&#39;hAxis.title&#39;, &#39;Date&#39;)<br>    .setOption(&#39;vAxis.title&#39;, &#39;Sales Amount&#39;)<br>    .build();<br>  sheet.updateChart(chart);<br>}<br>function createDashboard() {<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  <br>  // Clear existing dashboard elements<br>  sheet.clear();<br>  <br>  // Add data validation for product filter<br>  var productRange = sheet.getRange(&#39;E1&#39;);<br>  var products = [&#39;A&#39;, &#39;B&#39;];<br>  var rule = SpreadsheetApp.newDataValidation().requireValueInList(products).build();<br>  productRange.setDataValidation(rule);<br>  productRange.setValue(&#39;A&#39;);<br>  <br>  // Add a button to update chart<br>  var button = sheet.insertDrawing(Sheet.newDrawing());<br>  button.setName(&#39;Update Chart&#39;);<br>  button.setLinkUrl(&#39;#&#39;);<br>  <br>  // Set the initial range for the chart<br>  var range = sheet.getRange(&#39;A1:C10&#39;);<br>  <br>  // Create and insert the chart<br>  var chart = sheet.newChart()<br>    .setChartType(Charts.ChartType.LINE)<br>    .addRange(range)<br>    .setPosition(5, 5, 0, 0)<br>    .build();<br>  sheet.insertChart(chart);<br>}</pre><h3>Step 4: Set Up the Script Trigger</h3><p>To run this function automatically, set up a trigger:</p><ol><li>In the script editor, click on the clock icon (Triggers).</li><li>Click on + Add Trigger.</li><li>Set up a time-driven trigger to run createDashboard when the spreadsheet opens.</li></ol><h3>Step 5: Test Your Script</h3><ol><li>Enter your sales data in the Google Sheet.</li><li>Run the createDashboard function manually by clicking the play button in the script editor.</li><li>Use the filter and button to interact with the chart.</li></ol><h3>Benefits of Interactive Dashboards</h3><ol><li>Enhanced Data Visualization: Create dynamic and interactive charts that update in real-time.</li><li>Improved User Experience: Allow users to interact with data through filters and buttons, making it easier to explore and analyze data.</li><li>Efficiency: Automate the creation and updating of dashboards, saving time and reducing manual effort.</li></ol><h3>Next Steps</h3><p>Building interactive dashboards in Google Sheets using Google Apps Script can significantly enhance your data analysis capabilities. In future articles, we will explore more advanced dashboard features and how to integrate with other Google Workspace tools.</p><p>Stay tuned for more articles in this series, and soon you’ll be able to transform your Google Sheets into powerful, interactive dashboards tailored to your specific needs.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ce3561c6046" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Data Analysis in Google Sheets with Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/automating-data-analysis-in-google-sheets-with-google-apps-script-65ee43e82437?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/65ee43e82437</guid>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[google-sheets-script]]></category>
            <category><![CDATA[app-script]]></category>
            <category><![CDATA[google-sheets]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Fri, 28 Jun 2024 13:02:45 GMT</pubDate>
            <atom:updated>2024-06-28T13:02:45.461Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our Google Apps Script series! So far, we’ve covered the basics, custom functions, creating custom menus and dialogs, and integrating external APIs. In this article, we’ll explore how to automate data analysis in Google Sheets using Google Apps Script. This will help you save time and improve efficiency by automating repetitive data analysis tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWEcdoz2Bh73Il4qEE1Iww.png" /></figure><h3>Why Automate Data Analysis?</h3><p>Automating data analysis in Google Sheets can help you:</p><ul><li>Save time by eliminating manual data processing tasks.</li><li>Reduce errors and ensure consistency in your data analysis.</li><li>Focus on insights and decision-making rather than mundane tasks.</li></ul><h3>Getting Started with Automation</h3><p>To demonstrate how to automate data analysis, we’ll create a script that processes sales data, calculates key metrics, and generates a summary report.</p><h3>Step 1: Prepare Your Data</h3><ol><li>Create a new Google Sheet and enter your sales data. Your data might look something like this:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fNwsIIO3TVD6I1ejwnwr-A.png" /></figure><h3>Step 2: Open the Script Editor</h3><ol><li>Navigate to Extensions &gt; Apps Script to open the script editor.</li></ol><h3>Step 3: Write the Script to Automate Data Analysis</h3><p>Replace the existing code in the script editor with the following script:</p><pre>function analyzeSalesData() {<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  var data = sheet.getDataRange().getValues();<br>  <br>  var salesSummary = {};<br>  <br>  // Process data and calculate metrics<br>  for (var i = 1; i &lt; data.length; i++) {<br>    var date = data[i][0];<br>    var product = data[i][1];<br>    var amount = data[i][2];<br>    <br>    if (!salesSummary[date]) {<br>      salesSummary[date] = {<br>        totalSales: 0,<br>        products: {}<br>      };<br>    }<br>    <br>    salesSummary[date].totalSales += amount;<br>    <br>    if (!salesSummary[date].products[product]) {<br>      salesSummary[date].products[product] = 0;<br>    }<br>    <br>    salesSummary[date].products[product] += amount;<br>  }<br>  <br>  // Clear existing summary report<br>  var summarySheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(&#39;Summary&#39;);<br>  if (summarySheet) {<br>    summarySheet.clear();<br>  } else {<br>    summarySheet = SpreadsheetApp.getActiveSpreadsheet().insertSheet(&#39;Summary&#39;);<br>  }<br>  <br>  // Generate summary report<br>  summarySheet.appendRow([&#39;Date&#39;, &#39;Total Sales&#39;, &#39;Product&#39;, &#39;Sales Amount&#39;]);<br>  <br>  for (var date in salesSummary) {<br>    var totalSales = salesSummary[date].totalSales;<br>    for (var product in salesSummary[date].products) {<br>      var salesAmount = salesSummary[date].products[product];<br>      summarySheet.appendRow([date, totalSales, product, salesAmount]);<br>    }<br>  }<br>}</pre><h3>Step 4: Set Up the Script Trigger</h3><p>To run this function automatically, set up a trigger:</p><ol><li>In the script editor, click on the clock icon (Triggers).</li><li>Click on + Add Trigger.</li><li>Set up a time-driven trigger to run analyzeSalesData at your preferred frequency (e.g., daily, hourly).</li></ol><h3>Step 5: Test Your Script</h3><ol><li>Enter your sales data in the Google Sheet.</li><li>Run the analyzeSalesData function manually by clicking the play button in the script editor.</li><li>Check the “Summary” sheet to see the generated summary report.</li></ol><h3>Benefits of Automating Data Analysis</h3><ol><li>Time Savings: Automate repetitive tasks and focus on more important aspects of your work.</li><li>Consistency: Ensure that data analysis is performed consistently and accurately.</li><li>Efficiency: Quickly generate reports and insights without manual intervention.</li></ol><h3>Next Steps</h3><p>Automating data analysis in Google Sheets using Google Apps Script can significantly enhance your productivity. In future articles, we will explore more advanced automation techniques and how to create interactive dashboards in Google Sheets.</p><p>Stay tuned for more articles in this series, and soon you’ll be able to transform your Google Sheets into powerful, automated tools tailored to your specific needs.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65ee43e82437" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating External APIs with Google Sheets Using Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/integrating-external-apis-with-google-sheets-using-google-apps-script-f118a71dfe2b?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/f118a71dfe2b</guid>
            <category><![CDATA[google-sheets-script]]></category>
            <category><![CDATA[app-script]]></category>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[google-sheets]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Thu, 27 Jun 2024 20:08:16 GMT</pubDate>
            <atom:updated>2024-06-27T20:09:08.187Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our Google Apps Script series! So far, we’ve covered the basics, custom functions, and creating custom menus and dialogs. In this article, we will explore how to integrate external APIs with Google Sheets using Google Apps Script. This will allow you to pull in data from other services and create even more dynamic and powerful spreadsheets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWEcdoz2Bh73Il4qEE1Iww.png" /></figure><h3>Why Integrate External APIs?</h3><p>APIs (Application Programming Interfaces) allow different software applications to communicate with each other. By integrating external APIs with Google Sheets, you can:</p><ul><li>Fetch real-time data from various sources (e.g., weather, stock prices, social media).</li><li>Automate data collection and processing.</li><li>Enhance your Google Sheets with data from external services.</li></ul><h3>Getting Started with API Integration</h3><p>To demonstrate API integration, we’ll use the OpenWeatherMap API to fetch weather data and display it in Google Sheets.</p><h3>Step 1: Get an API Key</h3><ol><li>Sign up for a free account at <a href="https://openweathermap.org/">OpenWeatherMap</a>.</li><li>Navigate to the API keys section and generate a new API key.</li></ol><h3>Step 2: Open Google Sheets and Access the Script Editor</h3><ol><li>Create a new Google Sheet or open an existing one.</li><li>Navigate to Extensions &gt; Apps Script to open the script editor.</li></ol><h3>Step 3: Write the Script to Call the API</h3><p>Replace the existing code in the script editor with the following script:</p><pre>// Replace &#39;YOUR_API_KEY&#39; with your actual OpenWeatherMap API key<br>var API_KEY = &#39;YOUR_API_KEY&#39;;<br>var BASE_URL = &#39;https://api.openweathermap.org/data/2.5/weather&#39;;<br><br>function getWeatherData(city) {<br>  var url = BASE_URL + &#39;?q=&#39; + city + &#39;&amp;appid=&#39; + API_KEY + &#39;&amp;units=metric&#39;;<br>  var response = UrlFetchApp.fetch(url);<br>  var data = JSON.parse(response.getContentText());<br>  return data;<br>}<br><br>function writeWeatherDataToSheet() {<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  var city = sheet.getRange(&#39;A1&#39;).getValue();<br>  var weatherData = getWeatherData(city);<br><br>  sheet.getRange(&#39;B1&#39;).setValue(&#39;Temperature&#39;);<br>  sheet.getRange(&#39;C1&#39;).setValue(&#39;Weather&#39;);<br>  <br>  sheet.getRange(&#39;B2&#39;).setValue(weatherData.main.temp + &#39; °C&#39;);<br>  sheet.getRange(&#39;C2&#39;).setValue(weatherData.weather[0].description);<br>}</pre><h3>Step 4: Set Up the Script Trigger</h3><p>To run this function automatically, set up a trigger:</p><ol><li>In the script editor, click on the clock icon (Triggers).</li><li>Click on + Add Trigger.</li><li>Set up a time-driven trigger to run writeWeatherDataToSheet at your preferred frequency (e.g., daily, hourly).</li></ol><h3>Step 5: Test Your Script</h3><ol><li>In your Google Sheet, enter a city name in cell A1.</li><li>Run the writeWeatherDataToSheet function manually by clicking the play button in the script editor.</li><li>Check the sheet to see the fetched weather data.</li></ol><h3>Benefits of API Integration</h3><ol><li>Real-Time Data: Fetch and display real-time data from various external sources.</li><li>Automation: Automate data collection and processing, saving time and reducing manual effort.</li><li>Enhanced Functionality: Enhance your Google Sheets with additional data and capabilities from external services.</li></ol><h3>Next Steps</h3><p>Integrating external APIs with Google Sheets using Google Apps Script opens up endless possibilities. In future articles, we will explore more advanced API integrations and how to handle different data formats.</p><p>Stay tuned for more articles in this series, and soon you’ll be able to transform your Google Sheets into powerful, automated tools tailored to your specific needs.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f118a71dfe2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elevate Your Google Sheets Experience: Creating Custom Menus and Dialogs with Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/elevate-your-google-sheets-experience-creating-custom-menus-and-dialogs-with-google-apps-script-686fea555856?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/686fea555856</guid>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[app-script]]></category>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[google-sheets-script]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Mon, 24 Jun 2024 12:02:31 GMT</pubDate>
            <atom:updated>2024-06-24T12:02:31.729Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ap4GcDpsA48ZI6RZcwbsuQ.png" /></figure><p>Welcome back to our Google Apps Script series! So far, we’ve covered the basics and learned how to create custom functions. In this article, we’re going to explore how to create custom menus and dialogs in Google Sheets. These tools will help you build interactive and user-friendly applications within your spreadsheets.</p><h4>Why Create Custom Menus and Dialogs?</h4><p>Custom menus and dialogs can greatly enhance the usability of your Google Sheets by providing intuitive and interactive ways for users to execute scripts and input data. This is especially useful for complex workflows where users need to perform specific actions or enter data in a structured manner.</p><h4>Creating a Custom Menu</h4><p>Let’s start by creating a custom menu in Google Sheets. This menu will allow users to run scripts directly from the Google Sheets interface.</p><ol><li><strong>Open Google Sheets:</strong></li></ol><ul><li>Create a new Google Sheet or open an existing one.</li></ul><p>2. <strong>Access the Script Editor:</strong></p><ul><li>Navigate to Extensions &gt; Apps Script to open the script editor.</li></ul><p>3. <strong>Write the Menu Script:</strong></p><ul><li>In the script editor, enter the following code to create a custom menu:</li></ul><pre>function onOpen() {<br>  var ui = SpreadsheetApp.getUi();<br>  ui.createMenu(&#39;Custom Menu&#39;)<br>    .addItem(&#39;Show Alert&#39;, &#39;showAlert&#39;)<br>    .addToUi();<br>}<br><br>function showAlert() {<br>  var ui = SpreadsheetApp.getUi();<br>  ui.alert(&#39;Hello, world!&#39;);<br>}</pre><p>4. <strong>Save and Run the Script:</strong></p><ul><li>Save your script and refresh your Google Sheet. You should see a new menu called “Custom Menu” with an item “Show Alert”.</li></ul><p>5. <strong>Test the Menu:</strong></p><ul><li>Click on Custom Menu &gt; Show Alert. A dialog box should appear with the message &quot;Hello, world!&quot;.</li></ul><h4>Creating a Custom Dialog</h4><p>Now, let’s create a custom dialog that allows users to input data. We’ll create a form that asks for a user’s name and email, then logs this information.</p><ol><li><strong>Write the Dialog Script:</strong></li></ol><ul><li>Add the following code to the script editor to create and display a custom dialog:</li></ul><pre>function showForm() {<br>  var htmlOutput = HtmlService.createHtmlOutputFromFile(&#39;form&#39;)<br>      .setWidth(400)<br>      .setHeight(300);<br>  SpreadsheetApp.getUi().showModalDialog(htmlOutput, &#39;User Form&#39;);<br>}<br><br>function processForm(formObject) {<br>  Logger.log(&#39;Name: &#39; + formObject.name);<br>  Logger.log(&#39;Email: &#39; + formObject.email);<br>}</pre><p>2. <strong>Create the HTML File for the Dialog:</strong></p><ul><li>In the script editor, click on the + icon and select HTML. Name the file form.html and add the following HTML code:</li></ul><pre>&lt;form&gt;<br>  &lt;label for=&quot;name&quot;&gt;Name:&lt;/label&gt;&lt;br&gt;<br>  &lt;input type=&quot;text&quot; id=&quot;name&quot; name=&quot;name&quot;&gt;&lt;br&gt;&lt;br&gt;<br>  &lt;label for=&quot;email&quot;&gt;Email:&lt;/label&gt;&lt;br&gt;<br>  &lt;input type=&quot;email&quot; id=&quot;email&quot; name=&quot;email&quot;&gt;&lt;br&gt;&lt;br&gt;<br>  &lt;input type=&quot;button&quot; value=&quot;Submit&quot; <br>         onclick=&quot;google.script.run.withSuccessHandler(google.script.host.close).processForm(this.parentNode)&quot;&gt;<br>&lt;/form&gt;</pre><p>3. <strong>Update the Menu Script to Include the Dialog:</strong></p><ul><li>Update the onOpen function to include an option for showing the form:</li></ul><pre>function onOpen() {<br>  var ui = SpreadsheetApp.getUi();<br>  ui.createMenu(&#39;Custom Menu&#39;)<br>    .addItem(&#39;Show Alert&#39;, &#39;showAlert&#39;)<br>    .addItem(&#39;Show Form&#39;, &#39;showForm&#39;)<br>    .addToUi();<br>}</pre><p>4. <strong>Save and Test the Script:</strong></p><ul><li>Save your script and refresh your Google Sheet. Click on Custom Menu &gt; Show Form. A dialog box should appear with the form for name and email input.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*u9ltTGfD2rTzaW92hWoFYQ.png" /></figure><h4>Benefits of Custom Menus and Dialogs</h4><ol><li><strong>Improved Usability:</strong></li></ol><ul><li>Custom menus and dialogs provide a more intuitive way for users to interact with your scripts, reducing the need for manual script execution.</li></ul><p>2. <strong>Enhanced User Experience:</strong></p><ul><li>Dialogs and forms can guide users through complex workflows, ensuring data is entered correctly and processes are followed consistently.</li></ul><p>3. <strong>Increased Efficiency:</strong></p><ul><li>Automate repetitive tasks and data collection, freeing up time for more important work.</li></ul><h4>Next Steps</h4><p>Custom menus and dialogs are powerful tools for making your Google Sheets more interactive and user-friendly. In our next article, we will explore how to integrate external APIs with Google Sheets using Google Apps Script. This will allow you to pull in data from other services and create even more dynamic and powerful spreadsheets.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=686fea555856" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supercharge Your Google Sheets: Creating Custom Functions with Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/supercharge-your-google-sheets-creating-custom-functions-with-google-apps-script-931b247f762d?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/931b247f762d</guid>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[google-sheets-script]]></category>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[app-script]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Sun, 23 Jun 2024 07:43:30 GMT</pubDate>
            <atom:updated>2024-06-23T07:43:30.714Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome back to our series on Google Apps Script! In our previous article, we covered the basics of getting started with Google Apps Script and wrote a simple script to automate timestamps in Google Sheets. Today, we’re going to take things a step further by creating custom functions to enhance your Google Sheets even more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWEcdoz2Bh73Il4qEE1Iww.png" /></figure><h4>What are Custom Functions?</h4><p>Custom functions in Google Sheets are similar to built-in functions like SUM or AVERAGE, but with one major difference: you create them! With Google Apps Script, you can write your own functions to perform specialized calculations or data manipulations tailored to your specific needs.</p><h4>Creating Your First Custom Function</h4><p>Let’s start with a simple example. Suppose you need a function that converts temperatures from Celsius to Fahrenheit. Here’s how you can create this custom function:</p><ol><li><strong>Open Google Sheets:</strong></li></ol><ul><li>Create a new Google Sheet or open an existing one.</li></ul><p>2. <strong>Access the Script Editor:</strong></p><ul><li>Navigate to Extensions &gt; Apps Script to open the script editor.</li></ul><p>3. <strong>Write the Custom Function:</strong></p><ul><li>Replace the existing code in the script editor with the following function:</li></ul><pre>/**<br> * Converts Celsius to Fahrenheit.<br> *<br> * @param {number} celsius The temperature in Celsius.<br> * @return {number} The temperature in Fahrenheit.<br> * @customfunction<br> */<br>function CELSIUS_TO_FAHRENHEIT(celsius) {<br>  return (celsius * 9/5) + 32;<br>}</pre><p>4. <strong>Use the Custom Function in Your Sheet:</strong></p><ul><li>Go back to your Google Sheet and enter a temperature in Celsius in a cell, for example, 25.</li><li>In another cell, use your custom function like this: =CELSIUS_TO_FAHRENHEIT(A1). This will convert the temperature to Fahrenheit.</li></ul><h4>Advanced Example: Creating a Custom Function for Data Analysis</h4><p>Now, let’s create a more advanced custom function. Suppose you have a list of sales figures and you want to calculate the compound annual growth rate (CAGR). Here’s how you can do it:</p><ol><li><strong>Write the Custom Function:</strong></li></ol><p>In the script editor, add the following code:</p><pre>/**<br> * Calculates the Compound Annual Growth Rate (CAGR).<br> *<br> * @param {number} startValue The initial value.<br> * @param {number} endValue The final value.<br> * @param {number} periods The number of periods (years).<br> * @return {number} The CAGR as a percentage.<br> * @customfunction<br> */<br>function CAGR(startValue, endValue, periods) {<br>  return ((Math.pow(endValue / startValue, 1 / periods) - 1) * 100).toFixed(2);<br>}</pre><p>2. <strong>Use the Custom Function in Your Sheet:</strong></p><p>Enter your starting value, ending value, and number of periods in separate cells, for example:</p><ul><li>A1 = 1000 (starting value)</li><li>A2 = 2000 (ending value)</li><li>A3 = 5 (number of years)</li></ul><p>In another cell, use your custom function like this: =CAGR(A1, A2, A3). This will calculate the CAGR.</p><h4>Tips for Creating Effective Custom Functions</h4><ol><li><strong>Document Your Functions:</strong></li></ol><ul><li>Use comments to explain what your function does, its parameters, and its return value. This makes it easier for others (and yourself) to understand and use your function.</li></ul><p>2. <strong>Handle Errors Gracefully:</strong></p><ul><li>Add error handling to your functions to manage unexpected inputs. For example:</li></ul><pre>function CELSIUS_TO_FAHRENHEIT(celsius) {<br>  if (typeof celsius !== &#39;number&#39;) {<br>    return &#39;Error: Input must be a number&#39;;<br>  }<br>  return (celsius * 9/5) + 32;<br>}</pre><p>2. <strong>Test Your Functions:</strong></p><ul><li>Thoroughly test your functions with different inputs to ensure they work correctly in all scenarios.</li></ul><h4>Next Steps</h4><p>Custom functions are a powerful way to extend Google Sheets and tailor it to your needs. With a bit of practice, you’ll be able to create complex functions that perform sophisticated calculations and data manipulations.</p><p>In our next article, we will explore how to create custom menus and dialogs in Google Sheets using Google Apps Script. These tools will allow you to build interactive and user-friendly applications within your spreadsheets.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=931b247f762d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Power of Google Sheets with Google Apps Script]]></title>
            <link>https://medium.com/@erkanerkisi/unlocking-the-power-of-google-sheets-with-google-apps-script-3f2ad5a40be0?source=rss-8ace05a98bea------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f2ad5a40be0</guid>
            <category><![CDATA[google-sheets]]></category>
            <category><![CDATA[google-app-script]]></category>
            <category><![CDATA[google-workspace]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[app-script]]></category>
            <dc:creator><![CDATA[Erkan Erkişi]]></dc:creator>
            <pubDate>Sun, 23 Jun 2024 07:05:49 GMT</pubDate>
            <atom:updated>2024-06-23T07:07:54.630Z</atom:updated>
            <content:encoded><![CDATA[<p>Google Sheets is an incredibly versatile tool, but did you know you can extend its functionality even further using Google Apps Script? If you’re new to the world of automation and scripting, this article will guide you through the basics and get you started on your journey to becoming a Google Sheets power user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ap4GcDpsA48ZI6RZcwbsuQ.png" /></figure><h4>What is Google Apps Script?</h4><p>Google Apps Script is a JavaScript-based scripting language that allows you to automate tasks across Google’s suite of apps, including Sheets, Docs, Gmail, and more. It provides a platform to write custom functions, automate workflows, and integrate Google services seamlessly.</p><h4>Getting Started with Google Apps Script</h4><p>To begin using Google Apps Script, you need a Google account and a basic understanding of JavaScript. Follow these steps to start your first project:</p><ol><li><strong>Open Google Sheets:</strong></li></ol><ul><li>Create a new Google Sheet or open an existing one.</li></ul><p>2. <strong>Access the Script Editor:</strong></p><ul><li>Navigate to Extensions &gt; Apps Script. This will open a new tab with the Google Apps Script editor.</li></ul><p>3. <strong>Write Your First Script:</strong></p><ul><li>In the script editor, you’ll see a function named myFunction(). Let’s create a simple script that logs “Hello, world!” to the console.</li></ul><pre>function myFirstScript() {<br>  Logger.log(&quot;Hello, world!&quot;);<br>}<br></pre><p>4. <strong>Run Your Script:</strong></p><ul><li>Click the play button (triangle icon) to run your script. You may be prompted to authorize the script to access your Google account.</li></ul><p>5. <strong>View the Logs:</strong></p><ul><li>After running the script, go to View &gt; Logs to see the message &quot;Hello, world!&quot; logged by your script.</li></ul><h4>Practical Example: Automating Data Entry</h4><p>Let’s create a more practical script. Suppose you want to automate the process of adding a timestamp whenever a new entry is added to your sheet.</p><ol><li><strong>Set Up Your Sheet:</strong></li></ol><ul><li>Create a Google Sheet with columns: Name, Email, Timestamp.</li></ul><p>2. <strong>Write the Automation Script:</strong></p><ul><li>Replace the existing function in the script editor with the following code:</li></ul><pre>function onEdit(e) {<br>  var sheet = e.source.getActiveSheet();<br>  var range = e.range;<br>  if (range.getColumn() == 1 || range.getColumn() == 2) {<br>    var row = range.getRow();<br>    var timestampCell = sheet.getRange(row, 3);<br>    timestampCell.setValue(new Date());<br>  }<br>}</pre><p>3. <strong>Set Up the Trigger:</strong></p><ul><li>To run this function automatically whenever the sheet is edited, set up an onEdit trigger.</li><li>Go to the Script Editor, click on the clock icon (Triggers), and set up an onEdit trigger for the onEdit function.</li></ul><p>4. <strong>Test Your Script:</strong></p><ul><li>Go back to your sheet and add a new name or email. The script will automatically fill in the Timestamp column with the current date and time.</li></ul><h4>Benefits of Using Google Apps Script</h4><ol><li><strong>Time-Saving Automation:</strong></li></ol><ul><li>Automate repetitive tasks such as data entry, email notifications, and report generation.</li></ul><p>2. <strong>Enhanced Functionality:</strong></p><ul><li>Extend the capabilities of Google Sheets with custom functions and integrations.</li></ul><p>3. <strong>Seamless Integration:</strong></p><ul><li>Easily integrate Google Sheets with other Google services like Gmail, Drive, and Calendar.</li></ul><p>4. <strong>Cost-Effective:</strong></p><ul><li>Google Apps Script is free to use and comes with your Google account.</li></ul><h4>Next Steps</h4><p>Now that you’ve dipped your toes into the world of Google Apps Script, there’s so much more to explore. In future articles, we will dive deeper into advanced topics such as:</p><ul><li>Creating custom menus and dialogs in Google Sheets.</li><li>Building web apps with Google Apps Script.</li><li>Integrating external APIs with your Google Sheets.</li></ul><p>Stay tuned for more articles in this series, and soon you’ll be able to transform your Google Sheets into powerful, automated tools tailored to your specific needs.</p><p>Feel free to leave comments or questions below, and happy scripting!</p><p><em>Follow me on Medium for more articles on Google Apps Script and other tech tutorials.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f2ad5a40be0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>