Skip to content

A fast and simple way to slice spreadsheets data from Google Sheets or Excel – good solution for large data & non-technical professionals

Slide or filter an extract or subset of spreadsheet data using a simple and quick way for non-technical professionals – Using Excel or Google Sheets and python in google colab environment.

  • No deep knowledge on coding or python required.
  • No need to install ang program to your system.

The use-case:

you have a data in form of spreadsheets, likely in excel or google sheets which you want to filter based on some conditions and take a look at a subset sample of that data, or slice it. The data maybe too big and hence slow to load in google sheets or excel or it could be that your filters are not simply possible to apply using direct filters in gsheets or excel. There it comes our solution for your need in this video. The downloadable online script code solution template is available in the bottom where you can simply follow the instruction in the video, edit the solution for your need and run it to get your desired results.

  • There are many reasons you may want to take a look at that data directly in spreadsheets, play around with it to get the observation or information you want. But, it is easier to focus on the subset of data or slice of data which is more specific to your need, to increase speed and focus of your data exploration.

In this example, I have a data such as this (this is a fake data with imaginary values)

Let’s assume I want to filter and slice the data to only look at the individuals who are female AND have seniority in their job title. And of course many other possibility of slicing the data.

Follow the remaining of this article to see how it is done!

  • Here is the link for a related video tutorial:
Video tutorial



Initial Settings

Step 0 : Open a copy of this google colab script using your google account. Google Colab is a stand-alone and online platform to run python codes, no need to install any additional item in your system. read more about google colab here

Next, I go over explaining the solution in below, where you can edit the code based on your need at the end.

Step 1: the library loading for use in the google colab environment

In this tutorial, I assume you have your data as a csv file in your google drive.

This step take care of initial settings to connect your google colab to google drive.

  • If your data is in form of google sheets already, then you can use this tutorial to change the data input to read the data from google sheets: https://winswithdata.com/?p=12
  • Here is the tutorial, allocated just for understanding how to connect and read your data from google drive: https://winswithdata.com/?p=1

After this you are prompted to allow the connection to your google drive account.

Step by step guides

Step 2 and 3: specify the path your csv data file exists in your google drive. In this example, I have a data file csv called ‘MOCK_DATA (2).csv’ in the a folder called ‘Data’.

Step 4:

Define the condition in which you want to slice or filter or extract a subset of data

In this tutorial and vidoe, I explain couple cases, where you may look for

  • specific value for data columns such as postal codes in here
  • existence of specific substring or word such word ‘senior’ in a text or string column such as job_title column here
  • a combination of these condition to apply as AND or OR conditions

Step 5:

Apply your desired condition on the input data and create your output data

Step 6:

Save your final file in your google drive sample place as input file

Here is the link for a related video tutorial:

1 thought on “A fast and simple way to slice spreadsheets data from Google Sheets or Excel – good solution for large data & non-technical professionals”

  1. Pingback: Remove Duplicates from a spreadsheet based on all or subset of columns | Google sheets/Excel | Python/Colab | Data Solution for beginners - Wins With Data

Leave a Reply

Your email address will not be published. Required fields are marked *