Table of Contents
Five Google Sheets functions can reduce repeated filtering, copying, and row-by-row calculations: QUERY, IMPORTRANGE, ARRAYFORMULA, LET, and XLOOKUP. Each solves a different problem, so choose the function that matches the task rather than putting every calculation into one large formula.
The examples below use comma separators. Some spreadsheet locales require semicolons between arguments. Replace the example ranges with your own, and leave empty cells where a formula needs to expand its results. If cell references are unfamiliar, start with TipsMake's lesson on basic spreadsheet formulas.
1. QUERY: filter and summarize a table

QUERY uses the Google Visualization API Query Language, which resembles SQL but is not SQLite or a complete SQL database. Its arguments are a data range, a quoted query, and an optional count of header rows.
=QUERY(A1:C1000,"select A, sum(B) where C = 'Complete' group by A label sum(B) 'Hours'",1)For this example, column A contains team members, B contains numeric hours, and C contains task status. Row 1 holds the column headings. The formula keeps rows marked Complete, groups them by team member, and totals their hours.
Set the final argument to 1 for one header row or 0 for none. Otherwise, Sheets may guess. Keep each column's data type consistent: mixed numbers and text can cause minority types to be treated as null values. Check Google's QUERY reference for supported syntax.
2. IMPORTRANGE: bring in data from another spreadsheet

IMPORTRANGE reads a range from a separate Google Sheets file. Put the source spreadsheet's URL in cell A1, then enter this formula in another empty area:
=IMPORTRANGE(A1,"'Tasks'!A1:C1000")Replace Tasks with the source tab's name. The URL can also be written directly inside double quotes. This imports cell values; it does not make a full copy of the source file with all its formatting and other features.
The first connection may display #REF! with an Allow access prompt. That is a permission decision, not an assurance that the connection is safe. After permission is granted, editors of the destination spreadsheet can use IMPORTRANGE to read other parts of the source. Check who can edit the destination before connecting confidential data.
Import only the range you need and allow time for updates. A linked result should not be treated as an instant snapshot. Google's IMPORTRANGE documentation explains access and refresh behavior.
3. ARRAYFORMULA: calculate several rows from one cell

If column D contains working hours and E contains hourly rates, put this in F2:
=ARRAYFORMULA(IF(D2:D1000="","",D2:D1000*E2:E1000))Each populated row in D is multiplied by the corresponding rate in E. The IF condition keeps rows with no hours blank instead of filling them with zeros. Confirm that the rate is present and numeric for every row you want to calculate.
Keep F3:F1000 empty so the result can expand. Both input ranges must have matching sizes. New entries within rows 2–1000 are included; rows beyond that limit require extending the ranges. ARRAYFORMULA does not make every function work row by row, and some functions already expand without it.
4. LET: name and reuse an intermediate calculation

LET assigns names inside a formula. This example applies an illustrative 10% discount when the total reaches 1,000:
=LET(subtotal,SUM(F2:F1000),IF(subtotal>=1000,subtotal*0.9,subtotal))Here, subtotal is the result of SUM(F2:F1000). The final IF expression uses that name instead of repeating the SUM calculation. Adjust the threshold and discount to your actual rules.
Named expressions are evaluated once within LET. That can reduce repeated work and make a formula easier to inspect, but it does not guarantee a noticeable speed improvement for every sheet. Use descriptive names that do not resemble cell references.
5. XLOOKUP: return a value for a matching key

Suppose A2:A100 contains product IDs, B2:B100 contains prices, and H2 contains the ID you need:
=XLOOKUP(H2,A2:A100,B2:B100,"Not found",0)The formula finds an exact match in column A and returns the corresponding price from B. The fourth argument supplies a readable result when no match exists; the fifth explicitly selects exact matching, which is also the default.
The lookup and result ranges must align. With the default search direction, duplicate IDs return the first match, so check whether your IDs should be unique. Also check stray spaces and whether IDs are stored consistently as text or numbers. Unlike VLOOKUP, the result range can sit to the left of the lookup range.
Before relying on any of these formulas, test a known row, a blank input, and a missing or duplicate key. Check the output against the original data before replacing a working report.
Reader Comments 0
Sign in with email or Google to join the discussion.