0
0
Google Sheetsspreadsheet~8 mins

REGEXMATCH and REGEXEXTRACT in Google Sheets - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - REGEXMATCH and REGEXEXTRACT
Dashboard Goal

Find and extract specific patterns from a list of product codes to quickly identify valid codes and pull out key parts like region and product type.

Sample Data
RowProduct Code
2US-1234-XL
3EU-5678-M
4AS-ABCD-L
5US-9999-S
6XX-0000-XX
7EU-4321-XL
8InvalidCode
Dashboard Components
  • KPI Card: Valid Codes Count
    Formula: =SUMPRODUCT(--REGEXMATCH(B2:B8, "^[A-Z]{2}-\d{4}-[SML]{1,2}|XL$"))
    Shows how many product codes match the pattern: two uppercase letters, dash, four digits, dash, size code (S, M, L, XL).
  • Table: Validity Check
    Formula in C2: =REGEXMATCH(B2, "^[A-Z]{2}-\d{4}-(S|M|L|XL)$")
    Drag down to C8.
    Shows TRUE if the product code matches the pattern, FALSE otherwise.
  • Table: Extract Region
    Formula in D2: =REGEXEXTRACT(B2, "^[A-Z]{2}")
    Drag down to D8.
    Extracts the two-letter region code from the start.
  • Table: Extract Product Type
    Formula in E2: =REGEXEXTRACT(B2, "(S|M|L|XL)$")
    Drag down to E8.
    Extracts the size code at the end.
Dashboard Layout
+-------------------------+------------------------------+
| Valid Codes Count (KPI) | Product Codes Table           |
|                         | +------------+---------+--------+---------+|
|                         | | Code       | Valid?  | Region | Product |
|                         | |            |         |        | Type    |
|                         | +------------+---------+--------+---------+|
|                         | | US-1234-XL | TRUE    | US     | XL      |
|                         | | EU-5678-M  | TRUE    | EU     | M       |
|                         | | AS-ABCD-L  | FALSE   | AS     | L       |
|                         | | US-9999-S  | TRUE    | US     | S       |
|                         | | XX-0000-XX | FALSE   | XX     |         |
|                         | | EU-4321-XL | TRUE    | EU     | XL      |
|                         | | InvalidCode| FALSE   |        |         |
+-------------------------+------------------------------+
Interactivity

Add a filter dropdown to select Region codes (e.g., US, EU, AS, XX). When a region is selected, the table updates to show only product codes from that region. The Valid Codes Count KPI updates to count only valid codes in the selected region.

Self Check

If you add a filter for Region = "EU", which rows remain visible in the table and what is the updated Valid Codes Count?

Answer: Rows with product codes "EU-5678-M" and "EU-4321-XL" remain. Valid Codes Count updates to 2.

Key Result
Dashboard shows how to identify valid product codes and extract region and product type using REGEXMATCH and REGEXEXTRACT.