Skip to content
ErgaLab
Spreadsheet

Google Sheets Formula Generator

Pick the task you're trying to do — including Sheets-only functions like QUERY, ARRAYFORMULA and IMPORTRANGE — and get a ready-to-paste formula.

What do you want to do?

Use spreadsheet-style SQL to filter, sort, and select columns from a range in one formula.

Fill in the details

Generated formula

=QUERY(A1:D100, "SELECT A, B WHERE C = 'Active'")

How it works

Google Sheets shares most functions with Excel (VLOOKUP, IF, SUMIFS, TEXTJOIN), but also has a few of its own that don't exist in Excel at all: QUERY lets you filter and sort a range using SQL-like syntax in a single formula, ARRAYFORMULA applies a calculation to an entire column without copying the formula down every row, and IMPORTRANGE pulls data from a completely different spreadsheet.

Choose what you're trying to do, fill in your ranges and conditions, and copy the result directly into a cell. Already have a formula and want it explained instead? Use the Google Sheets Formula Explainer.

Examples

QUERY

Filter and sort in one formula.

=QUERY(A1:D100, "SELECT A, B WHERE C = 'Active' ORDER BY B DESC")

ARRAYFORMULA

Multiply two columns, every row at once.

=ARRAYFORMULA(B2:B100 * C2:C100)

IMPORTRANGE

Pull a range from another spreadsheet.

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/SPREADSHEET_ID", "Sheet1!A1:D100")

Frequently asked questions