Home / Tools / Google Sheets Formula Builder
Free tool · 2026

Google Sheets Formula Builder

Pick a function, fill in your ranges and conditions, and copy a formula that works the first time, with a plain-English note on what it does. Covers QUERY, VLOOKUP, XLOOKUP, SUMIFS, COUNTIFS, AVERAGEIFS, FILTER, UNIQUE, SORT, IMPORTRANGE and ARRAYFORMULA.

🔒 Runs entirely in your browser. No AI, nothing is uploaded

Use sheet column letters (A, B, C) everywhere. When the data comes from another spreadsheet, the builder converts them to Col1, Col2… for you.

Only rows where

Group and total

Sort and limit

A column letter, or agg to sort by the total.

Your formula


        

    How to use it

    1. Pick the function from the row of tabs. Not sure which? See which formula to use below.
    2. Fill in your ranges and columns the way they appear in your sheet: Sales!A1:E, column letters like B, values like West, 1,000 or 2026-01-31. Set a condition's type to Cell to compare with a value you keep in a cell, such as H1.
    3. Copy the formula into the top-left cell where the result should go. Formulas that return several rows spill down and to the right, so leave those cells empty.

    The builder writes US-style formulas with commas between arguments. If your spreadsheet locale uses a comma as the decimal mark, swap the argument commas for semicolons.

    Which formula should you use?

    You want to…UseWhy
    Pick columns, filter, group and total, sort, all in one stepQUERYOne formula does what would otherwise take FILTER, SORT, UNIQUE and SUMIFS together
    Get the matching rows exactly as they areFILTERSimpler than QUERY, case-insensitive, handles mixed data types in a column
    Get one number: a total, a count or an average with conditionsSUMIFS, COUNTIFS, AVERAGEIFSFast, and the result is a single cell you can reference elsewhere
    Bring in one value per row from another tableXLOOKUP (or VLOOKUP)XLOOKUP can look left and set a not-found value; VLOOKUP only looks right
    Make a clean list of distinct valuesUNIQUE + SORTBuilds a dropdown source or a summary row label list that updates itself
    Use data that lives in another spreadsheet fileIMPORTRANGEKeeps a live copy in sync; wrap it in QUERY to filter or total it
    Run a row formula down the whole column automaticallyARRAYFORMULAOne formula covers new rows as they are added, so nothing needs to be dragged down

    Common errors and how to fix them

    QUERY

    VLOOKUP and XLOOKUP

    SUMIFS, COUNTIFS and AVERAGEIFS

    FILTER, UNIQUE and SORT

    IMPORTRANGE

    ARRAYFORMULA

    When the formula is the hard part

    A QUERY with a filter, a group by and a sort is a small program, and every new question means writing another one. If what you actually want is the answer, the Quiriz add-on for Google Sheets lets you ask for it in a cell instead:

    =QUIRIZ("total sales by region over $1,000, biggest first", "table")

    The table comes back in the sheet. To be clear about what it does and doesn't do:

    Get Quiriz for Google Sheets →

    Skip the formula, ask the question

    Type a question into a cell with =QUIRIZ() and get a figure, a table or a chart computed from your data. No SELECT, WHERE or GROUP BY to write.

    Install for Google Sheets →

    Free on the Google Workspace Marketplace. Or try it on sample data first, no signup.

    Frequently asked questions

    Does this Google Sheets formula generator use AI?
    No. It's a guided builder that runs in your browser. You choose the function and fill in the ranges, columns and conditions; the page assembles the formula with fixed rules, so the same fields always give the same formula. Nothing you type is sent anywhere.
    When should I use QUERY instead of FILTER or SUMIFS?
    Use QUERY when you need several steps at once: pick columns, filter rows, group and total, sort and limit. Use FILTER when you want the matching rows exactly as they are. Use SUMIFS, COUNTIFS or AVERAGEIFS when you need a single number that answers one question.
    Why does QUERY use Col1 instead of column letters?
    QUERY accepts column letters only when the data is a plain range on a sheet, such as A1:E. When the data comes from another function, such as IMPORTRANGE or an array in curly braces, there are no letters, so columns are numbered Col1, Col2 and so on from the left edge of the data. The builder switches automatically when you choose Another spreadsheet.
    How do I write a date in a QUERY formula?
    Use the keyword date followed by the date in yyyy-mm-dd format inside single quotes: where C >= date '2026-01-01'. To use a date from a cell, join it in with TEXT: "where C >= date '"&TEXT(H1, "yyyy-mm-dd")&"'". Set the condition type to Cell: date and the builder writes that for you.
    Should I use VLOOKUP or XLOOKUP in Google Sheets?
    XLOOKUP when you can. It can look left, returns a value you choose when nothing matches, doesn't break when columns are inserted, and can search from the bottom up. VLOOKUP still works everywhere and is fine for a simple exact-match lookup to the right.
    Why does my formula show a parse error in my country?
    Many locales, including most of Europe and Latin America, separate arguments with semicolons instead of commas. The builder writes US-style formulas with commas. If your spreadsheet locale uses commas as the decimal mark, replace the argument commas with semicolons, or change the locale in File > Settings.

    Step-by-step guides

    More free tools for spreadsheet chores: remove duplicates, compare two lists, and the rest on the tools page.