> ## Content Index
> Fetch the complete content index at: https://www.jeffsu.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# Google Calendar: Export events to Google Sheets
- URL: https://www.jeffsu.org/productivity-ping-145/
- Published: 2024-02-09T01:00:39.000Z
- Updated: 2025-09-05T12:56:31.000Z
- Description: #145
- Author: Jeff
- Tags: #newsletter, Google Calendar

*(you can* [*filter previous issues*](https://www.jeffsu.org/filter-previous-editions-by-app/) *by application!)*

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/Gumroad--1920-x-1080-.jpg)

## 🤔 What is it?

By default, Google Calendar exports your calendar in .ics file format:

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-06-at-16.04.02@2x.png)

But a .ics file format is useless if you're trying to **view/manage your events in spreadsheet format**.

And 99% of the solutions found online recommend using a third-party tool to convert your .ics file to .csv (spreadsheet-friendly), which isn’t very secure…

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-06-at-16.02.48@2x.png)

## Step-by-step instructions

First, export your calendar and upload the .ics file onto your Google Drive (any folder will do).

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-08-at-10.41.11@2x.png)

Second, open up [Google Apps script](https://script.google.com/home/start?ref=jeffsu.org) (don’t worry I’ll share the code with you below) > New Project > rename your project to “ICS to Google Sheets”

Copy this code below and replace the placeholder code within your project:

```javascript
function importICSToSheet() {
  var icsFileId = 'YOUR_ICS_FILE_ID_HERE'; // Replace with your .ics file's ID
  var icsContent = DriveApp.getFileById(icsFileId).getBlob().getDataAsString();
  var lines = icsContent.split('\\r\\n');
  var events = [];
  var currentEvent = {}; // Initialize outside the loop
  
  // Parse the .ics file
  for (var i = 0; i < lines.length; i++) {
    if (lines[i].startsWith('BEGIN:VEVENT')) {
      currentEvent = {}; // Properly initialize for a new event
    } else if (lines[i].startsWith('END:VEVENT')) {
      events.push(currentEvent);
      currentEvent = {}; // Reset after pushing to avoid reference issues
    } else if (currentEvent && lines[i].startsWith('SUMMARY:')) {
      currentEvent.summary = lines[i].substr(8);
    } else if (currentEvent && lines[i].startsWith('DTSTART')) {
      currentEvent.startDate = lines[i].split(':')[1];
    } else if (currentEvent && lines[i].startsWith('DTEND')) {
      currentEvent.endDate = lines[i].split(':')[1];
    } else if (currentEvent && lines[i].startsWith('DESCRIPTION:')) {
      currentEvent.description = lines[i].substr(12);
    } else if (currentEvent && lines[i].startsWith('LOCATION:')) {
      currentEvent.location = lines[i].substr(9);
    }
  }
  
  // Create a new Google Sheet
  var sheet = SpreadsheetApp.create('Imported ICS Events').getActiveSheet();
  sheet.appendRow(['Title', 'Start Date', 'End Date', 'Description', 'Location']); // Headers
  
  // Write events to the sheet
  events.forEach(function(event) {
    sheet.appendRow([event.summary, event.startDate, event.endDate, event.description, event.location]);
  });
}

```

You should end up with something like this:

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-08-at-10.40.28@2x.png)

Next, right-click on the .ics file within Google Drive > Copy the share link, and find the File ID in the address bar:

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-06-at-16.08.19@2x.png)

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-06-at-16.09.19@2x.png)

Replace the ‘YOUR\_ICS\_FILE\_ID\_HERE’ with the File ID from your uploaded .ics file:

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-06-at-16.12.12@2x.png)

Save and Run the Apps script

💡

****Note:** This might take 10-20 minutes depending on how many events you have in your Google Calendar

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-06-at-16.13.38@2x.png)

After you see “Execution Completed,” go to your [Google Sheets homepage](https://docs.google.com/spreadsheets/u/0/?tgif=c&ref=jeffsu.org) and you should find a new file titled, “Imported ICS Events”

![](https://storage.ghost.io/c/db/85/db858a9d-1c4f-4993-8042-faa87b9bb3c1/content/images/2024/02/CleanShot-2024-02-06-at-16.14.46@2x.png)

I know the instructions seem a bit complicated so let me know if you run into any issues!

[I have a question!](https://www.jeffsu.org/productivity-ping-145/#ghost-comments-root)

---

**I’m always looking for ways to improve** so give me anonymous feedback [here](https://forms.gle/4Dscq21VYF3fjCcn8?ref=jeffsu.org) 📝

**Want someone to be more productive?** Let them subscribe [here](https://www.jeffsu.org/#/portal/signup) 😉

Thanks for being a subscriber, and have a great day!