Highlight Groups When Their Total Exceeds a Target in Google Sheets

Published on

When analyzing data in Google Sheets, you may need to highlight groups when their total exceeds a target. This helps quickly identify products, departments, or categories that surpass set thresholds. In this tutorial, you’ll learn how to apply conditional formatting to highlight groups when their total exceeds a target in Google Sheets.

We’ll primarily focus on the single-table format, where both target and actual values are in the same table. However, we’ll also briefly cover how to handle separate target and actual tables using lookup functions. Let’s start!

Generic Formula to Highlight Groups When Their Total Exceeds a Target

=SUMIF(Group_Range, Current_Group, Value_Range) > Target_Cell

Explanation:

  • Group_Range : The column containing group names/items/categories. (e.g., $A$2:$A)
  • Current_Group : The specific group/item being evaluated. (e.g., $A2)
  • Value_Range : The column with actual values to sum. (e.g., $C$2:$C)
  • Target_Cell : The reference cell containing the target value. (e.g., $B2)

Let’s apply this to sample data.

Step 1: Set Up the Sample Data

The sample data consists of products in column A, their target values in column B, and actual sales in column C.

Single Table Format for Target and Actual Values in Google Sheets

Since column A is sorted by product, you can easily verify group totals and compare them against targets. Sorting is not required for the highlighting to work.

Step 2: Apply Conditional Formatting to Highlight Groups When Their Total Exceeds the Target

Steps to Apply the Conditional Formatting Rule:

  1. Select the range → Select A2:A10 (or A2:C10 if you want to highlight all columns).
  2. Go to → Click Format > Conditional formatting.
  3. Choose Rule Type → Under Format rules, select Custom formula is.
  4. Enter the Formula=SUMIF($A$2:$A, $A2, $C$2:$C) > $B2
  5. Choose Formatting Style → Pick a highlight color.
  6. Click Done → The groups where the total exceeds the target will now be highlighted.

Highlight Groups When the Total Meets or Exceeds the Target

If you also want to highlight groups that meet or exceed the target, use this formula instead:

=AND(N($B2), SUMIF($A$2:$A, $A2, $C$2:$C) >= $B2)

Handling Separate Target and Actual Tables

In the above example, the target and actual values are in the same table. However, sometimes targets are stored in a separate table. In that case, you can use XLOOKUP to fetch the target value corresponding to each group:

Generic Formula for Separate Target and Actual Tables

=SUMIF(Group_Range, Current_Group, Value_Range) > XLOOKUP(Current_Group, Target_Lookup_Range, Target_Value_Range)

Explanation:

  • Group_Range : The column containing group names (e.g., $A$2:$A).
  • Current_Group : The specific group being evaluated (e.g., $A2).
  • Value_Range : The column with actual values to sum (e.g., $B$2:$B).
  • Target_Lookup_Range : The column in the target table containing group names (e.g., $D$2:$D).
  • Target_Value_Range : The column in the target table containing the target values (e.g., $E$2:$E).

Example Formulas:

  • Highlight when the total exceeds the target:
    =SUMIF($A$2:$A, $A2, $B$2:$B) > XLOOKUP($A2, $D$2:$D, $E$2:$E)
  • Highlight when the total meets or exceeds the target:
    =SUMIF($A$2:$A, $A2, $B$2:$B) >= XLOOKUP($A2, $D$2:$D, $E$2:$E)
Highlight Groups When Their Total Exceeds a Target Using Separate Tables in Google Sheets

Additional Tips & Wrap-up

Ensure the correct data range is selected before applying conditional formatting. If you’re using a separate target table, make sure the group names match exactly, avoiding extra spaces or inconsistent capitalization.

I recommend using XLOOKUP to fetch target values, but you can also use VLOOKUP.

By following this tutorial, you can highlight groups when their total exceeds a target in Google Sheets, making it easier to analyze data trends and spot key performance insights. Whether your target and actual values are in one table or separate tables, you can apply the right formula and formatting rule to get accurate results.

Let me know if you have any questions!

More Google Sheets Tips and Tutorials

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Count Consecutive Duplicates in Excel (Dynamic Array Formula)

Counting consecutive duplicates in Excel is useful for analyzing patterns, detecting repetitive sequences, and...

How to Break RANK Ties Alphabetically in Google Sheets

The RANK function in Google Sheets is commonly used to assign rankings to numerical...

Google Sheets: Highlight an Entire Column If Any Cell Has an Error

Google Sheets allows you to highlight an entire column if any cell has an...

Filter Top N per Category in Excel (Using FILTER & COUNTIFS)

You can use a combination of FILTER and COUNTIFS to filter the top N...

More like this

How to Break RANK Ties Alphabetically in Google Sheets

The RANK function in Google Sheets is commonly used to assign rankings to numerical...

Google Sheets: Highlight an Entire Column If Any Cell Has an Error

Google Sheets allows you to highlight an entire column if any cell has an...

Google Sheets: Extract Top N per Group from Query Aggregation

When working with grouped and aggregated data in Google Sheets, you might need to...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.