
SUMIF in Looker Studio is one of those skills that changes the way you build dashboards. If you’re used to Excel or Google Sheets, you already know the power of SUMIF: instead of summing everything, you only sum what meets a certain rule.
Looker Studio doesn’t include a native SUMIF function, but the logic is completely achievable using SUM(IF(condition, result_if_true, result_if_false)). Once you understand this pattern, you’ll be able to measure revenue by customer type, identify profitable product categories, or analyse performance by region. All without complex connectors or external transformations.
In this tutorial, we will walk through:
- What SUMIF in Looker Studio actually does
- How to build a basic SUMIF using the Superstore Products dataset
- How to add multiple conditions using AND and OR
- How to use SUMIF for numeric ranges
- How to avoid mistakes when mixing logical operators
- How to adapt the approach to COUNT_DISTINCT when duplicates exist
Understanding SUMIF in Looker Studio
There is no single “SUMIF” button in Looker Studio. Instead, we recreate it by combining an IF expression with SUM.
The general structure is:
SUM(
IF(condition, value_if_true, value_if_false)
)
Here is the mental model:
- IF runs at row level and decides whether a row counts or not.
- SUM aggregates the resulting values into a metric that Looker Studio can display in charts or tables.
This is a very safe pattern. It is widely used in professional dashboards and handles both simple and advanced logic well.
Example: the Superstore Products dataset
The Superstore Products dataset includes:
- Category
- Sub-Category
- Region
- Gross revenue
- Profit
- Discount
It behaves similarly to an online shop or B2B e-commerce catalogue. This makes it excellent for practising SUMIF in Looker Studio in a way that reflects real business decisions.
SUMIF in Looker Studio to count rows matching a rule
Let’s start with a simple question:
How many Technology products exist in the dataset?
Create a new calculated field:
IF(Category = "Technology", 1, 0)
This returns 1 when the category is Technology and 0 when it is not.
To turn this into a proper metric, wrap it in a SUM:
SUM(
IF(Category = "Technology", 1, 0)
)
The IF checks each row. SUM adds all the ones.
Place this in a scorecard or table and you will immediately see the total number of Technology products.
SUMIF in Looker Studio using a numeric value
Counting rows is useful, but SUMIF becomes powerful when you sum a field only when the condition is met.
Let’s ask a more business-focused question:
What is the total Gross revenue from Technology products?
Use:
SUM(
IF(Category = "Technology", Gross revenue, 0)
)
The row returns its actual revenue when the condition is true, and zero when it is false. SUM then gives you the total revenue only from Technology products.
SUMIF in Looker Studio with multiple conditions (AND)
Most real reports don’t include just one condition. Imagine you want to know:
What is the total revenue from Technology products sold in the West region?
Formula:
SUM(
IF(
Category = "Technology"
AND Region = "West",
Gross revenue,
0
)
)
Both conditions must be true for the value to be included.
A quick tip: write your conditions on separate lines. It makes debugging easier.
SUMIF in Looker Studio using OR logic
Now let’s imagine a slightly different scenario.
What is the total revenue from Chairs or Binders?
SUM(
IF(
Sub-Category = "Chairs"
OR Sub-Category = "Binders",
Gross revenue,
0
)
)
We accept either condition.
This approach is great when grouping categories that behave similarly in terms of revenue or discount strategy.
SUMIF in Looker Studio with numeric ranges
Ranges are common when analysing profit margins, shipping thresholds or product prices.
For example:
What is the total revenue from products with Gross revenue between 500 and 2,000?
SUM(
IF(
Gross revenue >= 500
AND Gross revenue <= 2000,
Gross revenue,
0
)
)
Using greater-than-or-equal and less-than-or-equal avoids boundary confusion and deals cleaner with decimal values.
Mixing AND and OR in SUMIF in Looker Studio
This is where many people experience incorrect results.
Looker Studio follows an operator precedence: AND is evaluated before OR unless parentheses change the order.
Let’s analyse:
What is the total revenue from Technology products sold in the West or East region?
Correct version:
SUM(
IF(
Category = "Technology"
AND (Region = "West" OR Region = "East"),
Gross revenue,
0
)
)
Those parentheses are your safety net. They make the logic explicit and predictable.
When SUMIF needs to become conditional COUNT_DISTINCT
Some datasets contain repeated rows, especially when imported from multiple systems.
If you use SUM(IF…) to count them, every duplicate will be counted.
In that case, a better approach is a conditional COUNT_DISTINCT.
Let’s answer:
How many unique products in the Technology category?
COUNT_DISTINCT(
IF(
Category = "Technology",
Product Name,
NULL
)
)
We return Product Name only when the condition is met and NULL otherwise. COUNT_DISTINCT ignores duplicates, giving you an accurate unique count.
FAQs – SUMIF in Looker Studio
How do I recreate SUMIF in Looker Studio?
Use the pattern SUM(IF(condition, value, 0)). IF filters rows, SUM aggregates results.
Can I sum revenue instead of counting rows?
Yes. Replace the 1 with a numeric field such as Gross revenue, Profit or Discount.
How do I combine multiple conditions?
Use AND, OR or a combination of both. Always add parentheses when mixing them.
When should I use COUNT_DISTINCT instead of SUM(IF)?
Use it when duplicates exist and you need unique counts (unique users, unique products, unique transactions).
I hope this guide helps you feel more confident when building SUMIF in Looker Studio with the Superstore Products dataset. Once you feel comfortable with this pattern, you will notice that many business rules can be translated into a single calculated field: segmentation by profitability, discount tiers, regional performance, product bundling analysis and much more.
The more you practise, the more you will realise that data is simply another language, and SUMIF helps you speak it clearly.



