How To
Jul 5, 2023

How to Categorize Data Using If Then Logic

I’ve always loved playing around with data. Whether it’s about sports or marketing, I have fun deriving insights and getting more information from the original data points.

While I used to rely on manual effort and a cluttered interface on spreadsheets, it all changed for the better when I discovered Gigasheet’s IF/THEN function.

In short, this function helps you manipulate your database using logical conditions to add more details. Simply feed interesting conditions to Gigasheet using this feature, and the tool will expand your database with great insights. It's the easiest way to categorize data!

If you aren't familiar with Gigasheet, it's an online spreadsheet that can open CSV files, and most other data and spreadsheet file types.

Let me show you how it works and help you get started with this cool function for refining your datasets.

How to Categorize Data Using Gigasheet’s IF/THEN function

The IF/THEN functionality on Gigasheet is designed to let users test different logical conditions and generate results based on these conditions. The function checks whether the condition set is valid or not, then displays results based on this condition.

Let’s look at how I used it on my trial database for the employee satisfaction index to perform five tasks and gain intriguing insights from this data.

Gigasheet IF function

Task 1: Divide employees into generation-based tags

First, I wanted to segregate the data into generations—Gen Z, millennials, and Gen X. So, I set three condition groups for a new column titled ‘Generation.’

  • Condition group 1: if age is less than or equal to 26, then Gen Z
  • Condition group 2: if age is greater than 26, then Millennial
  • Condition group 3: if age is greater than 41, then Gen X
Creating IF Statement to Categorize Data

Once I set all the conditions, I hit Insert to put Gigasheet to work and categorize my dataset.

Another condition to Categorize Data

Et voila! Here’s the result—a new column matching each employee into a new category relevant to their ages.

New column inserted with Data Categories

Task 2: Identify freshers based on education, age, recruitment type

Next, I wanted to spice things up and identify freshers among all the employees using three data points: education, age, and recruitment. Here’s how it went.

I set the new column name as ‘Freshers.’ Then, I wrote three conditions:

  • If education is UG
  • If the age is less than 26
  • If the recruitment type is on-campus

Notice that, unlike the first task, I didn’t create separate groups. Instead, I added all three conditions under a single group because the result for all three conditions was the same—Fresher.

Creating multi step logic to Categorize Data

In less than a second, Gigasheet gave me these results—like magic! It’s so easy to pinpoint those starting their careers right after grad school.

A new column with categorization

Task 3: Check which employees need a work-from-home setup

Since this employee dataset had a mix of remote and onsite workers, I was curious to know which employees would need allowance for setting up a workstation at home. So, I picked the employees working in the technology department for checking how many of them would need this allowance.

I picked four parameters to determine the employees’ expertise and gauge if they need a work-from-home allowance: job level, location, salary, and education.

Based on these parameters, I set these five conditions in a single group:

  • If the department is Technology
  • If awards are more than or equal to 4
  • If the location is suburb
  • If the salary is greater than 30,000
  • If education is PG

The results for this logic were Yes and No. Scroll to see the results!

5 Level conditional for Categorizing data

Guess what? All the results were negative. That means, no employee matched all the conditions I set.

Adding Column with categorization

Task 4: Assess employee satisfaction based on location and rating

Coming to my next task, I decided to check how satisfied employees were based on where they worked from—the suburbs or the city. I also wanted to correlate this data with their performance-based rating.

This conditional data would give me better insight into how location and performance impacted individual employee satisfaction levels.

I started with all employees living in the city. So, I created two condition groups with three logics each:

  • Condition group 1
  • If location is city
  • If the rating is greater than 3
  • If satisfied is 1
  • Then show the result as High
  • Condition group 2
  • If location is city
  • If the rating is greater than 3
  • If satisfied is 0
  • Then show the result as Low

Here are the screenshots for both these groups:

Condition group 1


Condition Group 2

Based on this logic, Gigasheet analyzed the data and displayed the satisfaction score for all employees living in the city. This helped me check how many employees with a higher rating (3+) were not satisfied with their jobs.

I can repeat the same steps to check out these results for employees in the suburb too.

Satisfaction categorized with High, Medium and Low

Task 5: Compare education and performance with salary

Another interesting insight I wanted to check was how employees educational qualification impacted their salary. Were employees with more awards getting paid higher or lower than others? Were employees with a post-graduate degree getting a higher salary or not?

I answered these questions and a few more by creating these three condition groups. The lowest salary benchmark was 30,000.

For the first group, I used education as the main parameter and set these conditions:

  • If education is PG
  • If the salary is more than 30,000
  • Then show the result as High
Creating categorization for salary


For the second group, I used the number of awards as the primary criterion and set these conditions:

  • If the number of awards is more than 3
  • If the salary is more than 30,000
  • Then show result as High
condition group 2 for salary

For the third group, I set the certifications as the main factor and set these conditions:

  • If certification equals 1
  • If the salary is more than 30,000
  • Then show the result as High
salary condition group 3

When I applied these conditions, Gigasheet gave me a complete rundown of those who are getting a high salary based on their degree, awards, and certifications against those getting underpaid. Check out the results below.

categorizing salary using If Then Function

Make Data Points Work for You Using Conditional Logic to Categorize Data

If you ever want to manipulate data and get more out of your database, then Gigasheet’s IF/THEN functionality is made for you. In this article, I showed you how effortless it is to work your way through this feature.

Now it’s your turn—sign up on Gigasheet, upload your dataset (or pick up any existing one), and play around with this function to get unique insights.

The ease of a spreadsheet with the power of a data warehouse.

No Code
No Training
No Installation
Sign Up, Free

Similar posts

By using this website, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.