How to Use IFERROR in Google Sheets
Every spreadsheet user has experienced the frustration of a formula gone wrong. You build what you think is a simple calculation, hit Enter, and get a...
Read the guide ›
Use VLOOKUP to find a value in the first column of a range and return a value from the same row. For product IDs, names or other exact keys, set the final argument to FALSE. Leaving it out enables approximate matching, which needs different preparation.
The example below uses invented product data. The lookup finds BK-104 and returns 29 from the third column of A2:C5. These instructions use the computer version of Google Sheets and English formulas with comma separators.

Suppose A1:C5 contains headers followed by four products. Column A holds IDs, B holds names, and C holds prices. Put the required ID in F2, then enter this formula in G2:
=VLOOKUP(F2,$A$2:$C$5,3,FALSE)
F2 is the key to find.$A$2:$C$5 is the table. The dollar signs keep it fixed when the formula is copied.3 returns the third column of that table, column C.FALSE requests an exact match rather than a sorted threshold lookup.Column numbers are relative to the selected range. In B2:D5, index 1 means B and index 3 means D. The search always happens in the range's first column. A range that merely includes the key column somewhere in the middle is not sufficient.
Copy G2 down for more lookups. F2 changes to F3, while the dollar-signed table stays fixed. Increase the table's last row when your source data grows beyond row 5.
VLOOKUP returns the first matching row, so repeated IDs can produce an unwanted result even when the formula is valid. Check keys with COUNTIF and review duplicate source records before deciding which record should remain. Do not delete legitimate repeated transactions merely because they share a product ID.
Text matching is case-insensitive. In a table containing Smith before smith, an exact lookup for smith can return the first Smith row. FALSE does not make capitalization significant. Leading or trailing spaces and a number stored as text can still prevent the intended match.
If missing keys are expected, use =IFNA(VLOOKUP(F2,$A$2:$C$5,3,FALSE),"Not found"). IFNA handles #N/A while leaving other errors visible. IFERROR catches a broader set of errors, which can conceal a broken formula if used without checking it.
For a tab named Products, use =VLOOKUP(F2,Products!$A$2:$C$5,3,FALSE). Put single quotes around tab names containing spaces: =VLOOKUP(F2,'Product List'!$A$2:$C$5,3,FALSE). The same first-column and index rules apply.
With TRUE, sort the first column in ascending order. A lookup uses an exact threshold when present, otherwise the nearest smaller threshold, and returns the corresponding result column. A key below the smallest threshold returns #N/A.
For an invented grade table with lower bounds 0, 60 and 80 and labels F, Pass and High, a lookup of 75 returns Pass. This is a threshold example, not a substitute for your school's grading policy. Use FALSE for IDs where a neighboring value would be the wrong record.
XLOOKUP is available in Google Sheets. It separates the lookup and result ranges, so the result can be to the left: =XLOOKUP(F2,A2:A5,C2:C5,"Not found"). INDEX with MATCH is another option. If you need a total across several matching rows rather than one returned value, use SUMIF.
Google's VLOOKUP reference covers the arguments and errors. Test one known key, one missing key and any repeated keys before filling a working report.
A common reporting task is combining two exports that share a page URL. One tab holds Search Console data with clicks and impressions per page, and another holds leads or sales per landing page from your analytics or CRM. A VLOOKUP on the URL brings the leads column into the Search Console tab, so each row shows both visibility and results.
Clean the keys first. URLs must match exactly, so remove tracking parameters, make trailing slashes consistent, and use the same protocol and hostname in both tabs. Wrap the formula in IFERROR to show a blank or a clear label instead of #N/A for pages with no leads; our guide to IFERROR in Google Sheets shows how.
When the same URL appears more than once in the lookup range, VLOOKUP returns only the first match. Remove duplicates first, or total the values with SUMIF instead. Our SEO team builds this kind of combined report for clients, so owners can see which pages bring visitors and which bring business.
Keep the report repeatable. Paste each new export into the same tab and columns every month, and keep the lookup formulas on a separate summary tab. The summary then updates itself, and nobody has to rebuild formulas when the numbers change.
FALSE requests an exact match. It does not require a sorted table or make text matching case-sensitive.
In exact-match mode, the key was not found in the first column of the selected range. Check the key, whitespace, data type and table selection.
VLOOKUP returns a column within its range starting from the search column. Use XLOOKUP or INDEX with MATCH when the desired result is to the left of the lookup column.
Use absolute references for the table, such as $A$2:$C$5, while keeping the lookup key relative when it should change for each row.
Check one URL in Swiss Knife SEO without an account. A free account supports crawls of up to 100 URLs.
Every spreadsheet user has experienced the frustration of a formula gone wrong. You build what you think is a simple calculation, hit Enter, and get a...
Read the guide ›SUMIF is a function that sums values in one range based on a condition in another range. A basic SUM function adds all values in a...
Read the guide ›One of the most frustrating tasks in Google Sheets is dragging a formula down hundreds of rows. You copy the formula, select the range, and paste....
Read the guide ›