← Guides

10 Google Sheets Formulas Every Office Worker Should Know

QUERY, IMPORTRANGE, ARRAYFORMULA, FILTER, UNIQUE, SPLIT, REGEXEXTRACT and more — with the everyday task each one solves.

Excel · 8 min read

By the FormulAI editorial team · Reviewed November 19, 2026

Sample data used in this guide

Sample "Sales" sheet (columns A to D).
A: DateB: ClientC: StatusD: Amount
02/03/2025AcmePaid400
05/03/2025BorealisPending250
09/03/2025AcmePaid150
12/03/2025CobaltPaid900
18/03/2025BorealisPaid300
21/03/2025CobaltCancelled120

1. QUERY: SQL inside a spreadsheet

QUERY lets you filter, group and sort with a SQL-like language. It is the fastest way to build a live summary of a sales sheet.

=QUERY(A1:D, "select B, sum(D) where C = 'Paid' group by B order by sum(D) desc", 1)
QUERY result: paid total per client, largest first.
Clientsum Amount
Cobalt900
Acme550
Borealis300

2. IMPORTRANGE: pull data from another file

Centralize data from several team spreadsheets. The first use requires clicking "Allow access" once.

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/FILE_ID", "Sales!A1:D")
First call: the cell shows #REF! with an "Allow access" button. After clicking, the other file's data appears.
StepCell content
Before access#REF!
After accessRange Sales!A1:D imported

3. ARRAYFORMULA: one formula for the whole column

Instead of dragging a formula down 5,000 rows, write it once. New rows are calculated automatically, which prevents the classic "formula missing on the last rows" error.

=ARRAYFORMULA(IF(B2:B="", , B2:B * C2:C))
On a sheet where B = quantity and C = unit price, a single formula in D2 fills the whole column:
B: QtyC: PriceD: Result
31236
5840
(blank)

4–6. FILTER, UNIQUE and SORT

FILTER(A2:D, D2:D > 1000) returns matching rows live; UNIQUE(B2:B) builds a clean list; SORT(range, column, FALSE) orders it. Combined, they replace most manual filtering.

=SORT(UNIQUE(FILTER(B2:B, C2:C="Paid"))) on the sample sheet:
Clients who paid
Acme
Borealis
Cobalt

7–8. SPLIT and REGEXEXTRACT for text

SPLIT(A2, " ") separates first and last names. REGEXEXTRACT(A2, "[\w.]+@[\w.]+") pulls an email out of a free-text cell — handy after copying data from emails or forms.

9–10. IFERROR and GOOGLEFINANCE

Wrap fragile formulas in IFERROR(formula, "") to keep dashboards clean, and use GOOGLEFINANCE("CURRENCY:EURUSD") for an up-to-date exchange rate in quotes and invoices. Remember that Google Sheets uses commas or semicolons as separators depending on the spreadsheet locale (File > Settings).

Common errors and how to fix them

#VALUE! Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: Client

Cause: QUERY does not accept header names, only column letters.

Fix: Write select B instead of select Client. With an IMPORTRANGE range, use Col1, Col2…

#REF! You need to connect these sheets.

Cause: IMPORTRANGE is used for the first time between these two files.

Fix: Hover the cell and click "Allow access". You also need at least view access to the source file.

#REF! Array result was not expanded because it would overwrite data in B5.

Cause: An array formula (FILTER, ARRAYFORMULA, QUERY) spills onto a cell that already holds data.

Fix: Clear B5 and the cells below, or move the formula to an empty area.

Formula parse error.

Cause: The separator does not match the file locale: a French-locale file expects ; instead of ,.

Fix: Check File > Settings > Locale and adapt the formula's separators.

FAQ

Do these formulas work in Excel?

FILTER, UNIQUE, SORT and IFERROR exist in Excel 365. QUERY, IMPORTRANGE, GOOGLEFINANCE and ARRAYFORMULA are specific to Google Sheets.

Does IMPORTRANGE update automatically?

Yes, the data is refreshed regularly while the file is open, with a short delay. It is not instant.

How do I filter QUERY on a date?

Use the date keyword and the yyyy-mm-dd format: where A >= date '2025-03-01'.

Go further

How this guide was made

Every formula, query and script in this guide was run on a real sample file (Excel 365, Google Sheets, PostgreSQL, MySQL or Python 3) before publication. We document the edge cases we hit during testing, such as text-formatted numbers, empty months or NULL values. AI helps us draft and translate; a human checks each example and updates the guide when software versions change. Spotted an error? Write to contact@formulai-app.com.