Export Google Calendar to Google Sheets: The Ultimate Guide

Export Google Calendar to Google Sheets: The Ultimate Guide
Video google calendar to google sheet

Google Calendar is widely known as one of the best tools for managing schedules and tasks. It captures your work and meetings, whether they are short or long. It has become a data source containing useful information about your professional life. In some cases, you may need to export your calendar data to Google Sheets. But which method should you use? Find the answer in this blog post.

Why would you need to export data from your Google Calendar to Sheets?

You may need a list of activities with the time spent on each, for purposes such as:

  • Sending invoices to clients, especially for hourly billed services.
  • Creating reports for administrative purposes.
  • Analyzing your productivity or that of your team. For example, knowing if you spend too much time on certain types of tasks, or if you prioritize high-priority tasks, etc.

Google Calendar has the data you need. You could click on each individual event in your calendar to see how much time you spent on each activity. However, it is always better to have your data automatically exported to Google Sheets. This saves you time and reduces errors. Plus, it’s easier to do basic data analysis in a spreadsheet, such as summing hours and sorting activities.

The best option for automatically exporting Google Calendar to Google Sheets

We have decided to play our best card by showing the best method to export Google Calendar to Google Sheets – Coupler.io.

You can use the Google Calendar integration by Coupler.io as a web application or as an add-on for Google Sheets. The latter option requires installing the add-on. In this article, we will use the web application. Nevertheless, the user interface and flow are the same for the web application and the add-on.

Why is this the best option? It allows you to automate the flow of data from your calendar to spreadsheets. Additionally, you can change the destination, transform the data along the way, and benefit from many other valuable features. Let’s see what it looks like in action!

Step 1. Collect the data

To start, click on “Proceed” in the form below. You will need to sign up for Coupler.io for free with your Google account, and then you will be directed to a newly created Google Calendar importer.

Next, connect your Google account associated with the calendar you want to export and select a category of data to export:

  • List of my calendars
  • List of my events
  • Report: busy time for the user

Then, select a calendar from which you want to extract data. You may optionally specify start and end dates or the date of the last update (it must be within the past 4 weeks from today).

Another optional parameter is advanced filters. After that, you can proceed to preview and transform the data.

Note: Coupler.io allows you to consolidate data from multiple sources. So you can add multiple calendars from which you want to export data and load them into a master view. To do this, click on “+Add one more source” and set up the connection as described above.

Step 2. Transform the data

At this step, you can preview the extracted data from Google Calendar and transform it along the way. Data transformation includes:

  • Hiding columns
  • Editing columns (changing name, changing data format)
  • Adding computable columns
  • Sorting columns
  • Filtering data

When everything is set up, move on to managing the destination.

You will need to connect your Google account associated with a Google Sheets spreadsheet where you will load the Google Calendar data. Then, select a spreadsheet and a sheet for the data. You can create a new sheet if you type a new name.

Optionally, you can select the first cell or range of cells where the calendar data will be imported; change the import mode from replace to append; enable the last updated column and disable data update for each run.

Step 3. Schedule updates

Finally, check the “Automatic data refresh” box and schedule your data exports. You can specify an update interval ranging from one month to every 15 minutes (this will make your report live).

Click “Run importer” when you are ready to make the first export from Google Calendar to Google Sheets and start the automation. Want to see how your calendar data looks in the spreadsheet? Here it is!

That’s pretty impressive, isn’t it? In addition to Google Calendar, Coupler.io also supports productivity and time tracking apps such as Clockify, Harvest, Calendly, and TimeTonic.

Check out the complete list of 60+ available sources to see if you can automatically export from your favorite apps. By the way, the same list of sources is available for importing into Excel, BigQuery, and various BI tools like Looker Studio and Power BI if you want to create truly amazing reports.

Speaking of reports, Coupler.io offers a “Free Automated Google Calendar Report” in Looker Studio that provides an overview of meetings for 2023. This report connects to your Google Calendar and answers many questions: how many meetings you had, how much time you spent, who are the top meeting organizers, etc.

Find out more about the report and how easy it is to set up in less than 2 minutes!

Now, let’s look at some other solutions for exporting your calendar to Google Sheets.

Can I export Google Calendar to a spreadsheet with native functionality?

Unfortunately, currently, there is no feature in Google Calendar that allows you to directly export data to Google Sheets. What you can do is export the ICS file of an individual calendar.

A .ics file is a standard internet calendar format that stores calendar event data. It is used by multiple calendar programs including Microsoft Outlook, Google Calendar, Yahoo! Calendar, and Apple Calendar. With the ICS format, you can share your calendar data with someone using a program other than Google Calendar.

Follow the steps below if you want to export ICS files for all your calendars associated with your Google account.

  1. Open Google Calendar. In the top right corner, click on the “Settings” icon, then click on “Settings” in the menu.
  2. On the settings page, click on the “Import & Export” menu > “Export”. Then, under the “Export” section, click on the “Export” button.

You will see a ZIP file downloaded to your computer. Unzip it, and you will find individual ICS files for each of your calendars.

Now, you can share these ICS files (or one of them) with your friend. They should be able to open it using their calendar program – Outlook, Yahoo! Calendar, or Apple Calendar.

How to export Google Calendar to Google Sheets using add-ons

The most convenient way to transfer calendar data to Google Sheets is by using a Google Sheets add-on. As mentioned earlier, Coupler.io is available as an add-on for Google Sheets.

At the same time, there are a few other options that allow you to get data from the calendar, such as Calendar to Sheet and Sheets2GCal. Unfortunately, none of these add-ons allow you to automatically export data from your calendar.

GSheets add-ons are third-party software applications. You can browse the add-ons library by clicking on “Add-ons” > “Get add-ons” in the top menu. This will open a new dialog window where you can browse or search for a specific add-on. Alternatively, you can go directly to the Google Workspace Marketplace and search for options there.

Click on each add-on to see a description of what it does. To install it, click on the “Install” button. It will ask for permission to access your Google Drive, and you need to give it that permission to complete the installation.

Now, let’s discuss two of these add-ons, Calendar to Sheet and Sheets2GCal.

Export calendar data with Calendar to Sheet add-on

Calendar to Sheet allows you to import events from your Google Calendar into Google Sheets by applying date and text filters. After installing the add-on, you will see it in the “Add-ons” menu.

Before importing data, you need to specify the calendars you want to import. You can also add text and date filters.

Here is an example of the result of importing calendar data with Calendar to Sheet:

Please note that you have event information such as start time, end time, event description, duration, notes, and location exported to the spreadsheet. Total duration information is also displayed at the top of the page.

Export calendar data with Sheets2GCal add-on

Sheets2GCal allows you not only to import events from Google Calendar into Google Sheets but also to update the calendar from the spreadsheets. To get started after installation, click on “Add-ons” > “Sheets2GCal” > “Import (Calendar > Sheet)” to import data from Google Calendar.

You will need to specify the calendar you want to import. You can also set the start date and end date if you desire. However, before you can import, you need to sign up for free at sheets2gcal.com.

Click on the “Import Events” button, and you will get a result similar to the one below.

Notice that the result contains more fields compared to the result from Calendar to Sheet. However, it does not contain a column indicating the duration, so you will need to calculate it yourself. Here’s how you can do that:

  1. Insert a new column “Duration (hh:mm)” after the “End Time” column.
  2. Enter this formula in an empty cell below the new column:
=G2-F2
  1. Apply the formula to other cells by selecting the formula cell and dragging the fill handle down to the other cells.

If your dataset is quite large, it’s better to use the ARRAYFORMULA function instead of dragging the formula. Here’s how it will look:

=ARRAYFORMULA(IF(len(G2:G)>0,(G2:G-F2:F),""))

Other options to export Google Calendar information to Sheets without coding

One of the SaaS tools that can help you export Google Calendar to Google Sheets is TimeTackle. It started as a simple calendar exporter called Gcal2Excel. Now, they have expanded the list of features and sources, so you may consider it for your needs if you want to save time by performing advanced analytics, generating invoices, creating many custom reports, and automatically exporting on a schedule.

What TimeTackle can do:

  • Export Google Calendar to Excel, CSV, and Google Sheets.
  • Export with tags and color options (calendar color or event color).
  • Sync Google Calendar with Google Sheets and schedule automatic syncs.
  • Automatically create invoices from calendar entries.
  • Generate various types of custom reports.
  • Provide advanced calendar analytics.

Once signed up, you will be prompted to connect your calendar.

After that, you will be able to add tags, view your calendar entries in a timesheet format, analyze meeting health, trends, interactions, and more.

TimeTackle allows you to automatically sync your Google Calendar with Google Sheets. To enable this feature, go to the “Timesheet” tab in the left menu, then find the “Google Sheets Sync” button at the top right. Click on it and set your preferences for updates.

Once done, new meetings and other calendar entries will automatically appear in the selected spreadsheet. TimeTackle will update your data according to your settings.

If needed, you can download your data from the same menu by clicking on the “Download” button. Available formats are XLSX and CSV.

How to export Google Calendar to Sheets using Google Apps Script

Above, we have covered solutions without coding. Now, let’s explore how you can export calendar data using Google Apps Script.

No need to worry, even if it’s your first script. We have provided the copy-paste solution for you, so you won’t have to do the coding yourself. Feel free to check out our tutorial on Google Apps Script.

Exporting Google Calendar events to Google Sheets using App Script

Before we start, you need to get the ID of your calendar.

How to get the calendar ID:

Open Google Calendar, then click on the “Settings” icon > “Settings” in the top right. On the settings page, scroll down to the calendar you want to export. Select “Integrate calendar” in the left menu. Then, copy the value of the “Calendar ID” displayed in the right pane, as shown in the screenshot below.

You can also simply use your Google email address as the calendar ID if you prefer. In this case, all your calendars will be exported.

Now, follow the easy steps below:

  1. Create a blank Google Sheets document. Give it a name, for example, “Google Calendar Import.”
  2. Copy and paste your calendar ID into cell “B1.”
  3. Specify data filtering criteria:
    • Start date (cell “B2”) in the format mm/dd/yyyy hh:mm:ss.
    • End date (cell “B3”) in the format mm/dd/yyyy hh:mm:ss.
    • Text to search (cell “B4”).

Note: The start and end date values should be formatted as date/time.

  1. In the menu, click on “Tools” > “Script editor.”
  2. Remove all code in “Code.gs.” Then, copy and paste the following “importGoogleCalendar()” function into the file.
function importGoogleCalendar() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var calendarId = sheet.getRange('B1').getValue().toString();
  var calendar = CalendarApp.getCalendarById(calendarId);

  // Set filters
  var startDate = sheet.getRange('B2').getValue();
  var endDate = sheet.getRange('B3').getValue();
  var searchText = sheet.getRange('B4').getValue();

  // Print header
  var header = [["Title", "Description", "Start", "End", "Duration"]];
  var range = sheet.getRange("A6:E6");
  range.setValues(header);
  range.setFontWeight("bold");

  // Get events based on filters
  var events = (searchText == '')
    ? calendar.getEvents(startDate, endDate)
    : calendar.getEvents(startDate, endDate, { search: searchText });

  // Display events
  for (var i = 0; i < events.length; i++) {
    var row = i + 7;
    var details = [[events[i].getTitle(), events[i].getDescription(), events[i].getStartTime(), events[i].getEndTime(), '']];
    range = sheet.getRange(row, 1, 1, 5);
    range.setValues(details);

    // Format the Start and End columns
    var cell = sheet.getRange(row, 3);
    cell.setNumberFormat('mm/dd/yyyy hh:mm');
    cell = sheet.getRange(row, 4);
    cell.setNumberFormat('mm/dd/yyyy hh:mm');

    // Fill the Duration column
    cell = sheet.getRange(row, 5);
    cell.setFormula('=(HOUR(D' + row + ')+(MINUTE(D' + row + ')/60))-(HOUR(C' + row + ')+(MINUTE(C' + row + ')/60))');
    cell.setNumberFormat('0.00');
  }
}

Note: You can also set up the filters directly in the script:

// Set filters
var startDate = new Date("December 1, 2020 00:00:00");
var endDate = new Date("December 31, 2020 23:59:59");
var searchText = 'Dev';

If you don’t want to apply a text filter, set the value of “searchText” to an empty string, like this:

var searchText = '';
  1. Run the script from the editor. The first time you run it, you will be prompted to authorize access to your Google account and data. Grant the permission when prompted.

Here is the result:

Note: The first time you run the script, you may see a consent popup to confirm that you want to allow the application to access your Google account and data. Give consent to allow the script to function properly.

Now, whenever you want to export calendar data, click on the “Import Calendar” menu > “Import.”

Setting up a button to export Google Calendar to Google Sheets

It’s not always convenient to run the script from the editor. So, let’s tweak the script a bit to be able to run it directly from the spreadsheet.

Add the following function to the “Code.gs” file:

function onOpen() {
  "use strict";
  var menuEntries = [{ name: "Import", functionName: 'importGoogleCalendar' }],
      activeSheet;

  activeSheet = SpreadsheetApp.getActiveSpreadsheet();
  activeSheet.addMenu('Import Calendar', menuEntries);
}

Now, your script has two functions: onOpen() and importGoogleCalendar(), as shown in the screenshot below:

Note: The onOpen() function adds a custom menu “Import Calendar” every time you open the spreadsheet. It has the sub-menu “Import” that calls the importGoogleCalendar() function.

Save the script, then refresh your spreadsheet. You will see a new menu added to your spreadsheet.

Now, whenever you want to export calendar data, click on the “Import Calendar” menu > “Import.”

Configuring automatic export from Google Calendar to Google Sheets with Google Apps Script

If you don’t want to click the “Import Calendar” button every time, you can schedule the export of data from Google Calendar to Google Sheets. For this, you need to set up a time-based trigger in your Apps Script project. Go to the “Triggers” section of your Apps Script project.

Then, click on “+ Add Trigger” at the bottom right of the window.

In the new window, you need to configure the trigger.

  1. Choose which function to run: select the function you want to automate on a schedule. Since we have two functions, onOpen() and importGoogleCalendar(), we need to choose the one that imports Google Calendar data into the spreadsheet.
  2. Choose which deployment should run: if you have different deployments, choose the one that matches.
  3. Select event source: from the spreadsheet, time-driven trigger, or calendar. In our case, we need “Time-driven”.
  4. Select type of time-based trigger: a specific date and time, a timer in minutes, a timer in hours, a timer in days, a timer in weeks, or a timer in months. We want to import data from the calendar every day, so we need “Day”.
  5. Select the hour of day: choose the time you want to import data every day.
  6. Failure notification settings: you can select how often to receive notifications in case of failure: immediately, every hour, every day, or every week. If you click the “+” symbol, you can set up multiple notifications.

When you’re ready, click “Save”. Your time-based trigger will appear in the list.

Bonus: From Google Sheets to Google Calendar

Suppose you worked during holidays and simply recorded your activities in a spreadsheet. To keep track of your schedules, you can automatically export your entries to Google Calendar. The following example shows you how to do that using a script.

Export dates in Google Sheets to Google Calendar

Before diving into the code, make sure that the dates in your spreadsheet have the correct format to facilitate the export.

  1. Select the dates, then click “Format” > “Number” > “Date time” in the menu.

Now, you’re ready to export to Google Calendar.

Google Apps Script to export from a spreadsheet to a calendar

Follow the steps below to create the script.

  1. Click on “Tools” > “Script editor”.
  2. Remove all code from “Code.gs”. Then, copy and paste the following code.
function exportToCalendar() {
  var calendarId = "your-calendar-ID@group.calendar.google.com";
  var calendar = CalendarApp.getCalendarById(calendarId);
  var sheet = SpreadsheetApp.getActiveSheet();
  var events = sheet.getRange("A2:C3").getValues();

  for (x = 0; x < events.length; x++) {
    var evt = events[x];
    var title = evt[0];
    var startTime = evt[1];
    var endTime = evt[2];
    calendar.createEvent(title, startTime, endTime);
  }
}
  1. Modify the value of “calendarId” in the script (your-calendar-ID@group.calendar.google.com) with your own.

  2. Run the script from the “editor”. The first time you run it, you will be prompted to authorize access to your data. Grant permission if necessary.

  3. Refresh your Calendar. You will see new events added for the specified dates.

Conclusion

We have explored several options for exporting Google Calendar to Google Sheets, with or without coding. If you want a simple solution, try using an add-on or Google Apps Script. If you want to save time by performing advanced analytics and reports, you may want to opt for Coupler.io. We hope that one of the options explained here is the best choice for you!

Related posts