Syntax
MATCH(search_value, range, [search_type])
- search_value—What you’re looking for. This can be a text string (enclosed in quotes), a number, a date, or a cell reference.
- range—Where you’re looking for it. This is the column, or range of cells, that contains your potential matches.
- search_type—[optional][optional but highly recommended] How strict the search must be. This numerical argument tells Smartsheet whether to require for an exact match or accept an approximate one.
Sample usage
MATCH("Task A", [Task Name]:[Task Name], 0)
Usage notes
For the optional search_type argument:
- For approximate matches, the data in the range must be sorted either in ascending order (smallest to largest/A-Z) or descending order (largest to smallest/Z-A) to prevent unexpected results.
- If you don't define this value, Smartsheet defaults to accepting approximate matches and assumes data is sorted in ascending order.
- 1 (The default value): Reviews the range until it finds an exact match, or a value greater than the search value. If it finds a value beyond the search value, the result is the previous position of that larger value.
- 0: Finds the first exact match (No sort order required)
- -1: Reviews the range until it finds an exact match, or a value smaller than the search value. If it finds a value before the search value, the result is the previous position of that smaller value.
- For almost all direct data lookups, use 0 for search_type. This ensures you find the value you asked for, and your source data doesn't need to be sorted.
- Even if your data is sorted, when an exact match is required, use ,0 to prevent the function from accepting approximate matches.
- The relative position found by MATCH will align with the row number only when a complete single column of data is selected, if part of a colum, or multiple columns are selected, the relative position will not be the same as the row number.
- Smartsheet counts the relative position of a search value by counting cells from left to right (across columns), then top to bottom (across rows) within the selected range.
- In a lookup table consisting of two columns, the cell in the top row of the leftmost column is the first position, 1, regardless of its position within the sheet.
- When working with text (string) data, the function considers letters later in the alphabet as greater than the search value and letters earlier in the alphabet as smaller.
- Approximate matches (search type 1 and -1) are determined by finding the last value in the list before going beyond the search value, and using that as the closest match.
- When the search_type is undefined, the MATCH function may fail to find the expected value when a larger value is located earlier in the list.
- Additionally, MATCH may give a #NO MATCH result for approximate matches if the first value in the list is beyond the search value
For example, if you have a column listing various products, the MATCH function can tell you if Pants is the 1st, 5th, or 10th product on that list. It returns a number representing that item's relative place, with the very first item in the selected range always being position 1. This is particularly useful when you need to combine it with other functions, like INDEX, to retrieve related information.
Examples
Example 1: Basic in-sheet position finding
Let's say you have a column of Product Names, and you want to know which row number the item Jacket is on.
Row # | Product name |
1 | T-shirt |
2 | Pants |
3 | Jacket |
Formula: =MATCH("Jacket", [Product Name]:[Product Name], 0)
Result: 3
The formula returns 3 because Jacket is in the third position within the range.
Example 2: Reference the current row dynamically
In Example 1, the formula searches for a hardcoded value, which means that it always returns the position of "Jacket", no matter where you use the formula. But what if you want MATCH to automatically find the position of whatever product is listed in each row?
Replace the hardcoded value with [Product Name]@row. This tells MATCH to use the value in the current row as the search value, making the formula reusable across every row in your sheet.
Add a Position column to your sheet and enter this formula:
=MATCH([Product Name]@row, [Product Name]:[Product Name], 0)
Row # | Product name | Position |
1 | T-shirt | 1 |
2 | Pants | 2 |
3 | Jacket | 3 |
Each row now returns its own position automatically. If the rows are reordered, new rows are added, or existing rows deleted, the Position value updates to match the new position within the sheet.
This is especially useful when you use MATCH as part of an INDEX(MATCH) formula, and instead of looking up one fixed item, your formula adapts to each row on its own.
Example 3: (search_type 1) and (search_type -1)
Examples A and B use the following reference table. To apply it in your formulas, add a table to a separate sheet and create cross-sheet references.
Alphabetical group assignments
Group | Cutoff |
Group 1 | A |
Group 2 | Be |
Group 3 | Ch |
Group 4 | Ed |
Group 5 | Hi |
Group 6 | Jo |
Group 7 | Ke |
Group 8 | No |
Leave Row 1 of the search range blank, use A (for text) or 0 (for numbers) to avoid getting a #NO MATCH error message if your search value is before your first “cuttoff” value. Alternatively, use IFERROR to define the value you want to see for items that happen before the first cutoff.
Example A: Find an approximate match in ascending order (search_type 1)
Use search_type 1 when your data is sorted A–Z or smallest to largest, and you want to find the closest value without going over, like assigning values to a bracket or category based on where they fall in a range.
Scenario: You're managing event registrations and need to assign each attendee to a group based on their last name. Instead of a long nested IF formula that breaks every time the cutoffs change, you maintain a small reference table and let MATCH do the work.
When MATCH uses search_type 1, it finds the position of the last cutoff value that doesn't come after the attendee's last name. That position is the group number.
="Group " + MATCH([Last Name]@row, {Cutoff}, 1)
Last Name | Group assignment |
Anderson | Group 1 |
Chen | Group 2 |
Johnson | Group 5 |
Kim | Group 6 |
For "Johnson," MATCH scans the Cutoff column in ascending order and finds that "Johnson" falls after "Jo" (Group 5's cutoff) but before "Ke" (Group 6's cutoff). It returns position 5, and the formula outputs "Group 5."
Using MATCH instead of a nested IF works best because when cutoffs change, for example, if the groups become unbalanced, you update the reference table but don't need to change the formula. You can add a new group, adjust a boundary, or rename a group, and the formula stays the same, simply using the new reference points.
For this to work correctly, the Cutoff column in your reference table must be sorted in ascending (A–Z) order, and have a blank row as the first range value, or an IFERROR to catch items before the first cutoff
Example B: Find an approximate match in descending order (search_type -1)
Example B uses the following reference table. To apply it in your formulas, add a table to a separate sheet and create cross-sheet references.
Newsletter schedule
Newsletter | Publication date | Submission cutoff date |
Q4 2027 | 10/05/27 | 09/25/27 |
Q3 2027 | 07/05/27 | 06/26/27 |
l Q2 2027 | 04/05/27 | 03/27/27 |
Q1 2027 | 01/04/27 | 12/26/26 |
Use search_type -1 when your data is sorted Z–A or largest to smallest, and you want to find the closest value at or above the search value, like matching a date to the next upcoming deadline.
Scenario: Your team submits content requests with a Requested Date (see table below). You need each row to automatically show which newsletter edition that content belongs to, based on the submission cutoff dates (as shown in the table above). The newsletter schedule is sorted in descending order (most recent first).
MATCH scans the Submission Cutoff Date column from top to bottom and finds the first cutoff date that's greater than or equal to the requested date. That's the edition the content belongs to.
=INDEX({Newsletter}, MATCH([Requested Date]@row, {Submission Cutoff Date}, -1))
Requested date | Newsletter edition |
09/20/27 | October 2027 |
10/30/27 | December 2027 |
07/15/27 | August 2027 |
For a requested date of 09/20/27, MATCH scans the Submission Cutoff Date column (sorted descending) and finds 09/25/27 as the first cutoff date that's greater than or equal to 09/20/27. That's position 1 in the table, which corresponds to Q4 2027.
INDEX then uses that position to return the newsletter name from the Newsletter column.
For this MATCH example to work correctly, the Submission Cutoff Date column in your reference table must be sorted in descending (Z–A or newest to oldest) order.
Example of using MATCH in a sheet
This example references the following sheet information:
| Row # | Clothing Item | Transaction Total | Units Sold | Price per Unit | Order Date |
|---|---|---|---|---|---|
| 1 | T-shirt | $1,950.00 | 78 | $15.00 | 02/12/25 |
| 2 | Pants | $1,491.00 | 42 | $35.50 | 02/15/25 |
| 3 | Jacket | $900.00 | 45 | $20.00 | 02/20/25 |
Based on the table above, here are some examples of using MATCH in a sheet:
| Formula | Description | Result |
|---|---|---|
=MATCH("Pants", [Clothing Item]:[Clothing Item], 0) | Returns the position for Pants in the Clothing Item column | 2 |
=MATCH(42, [Units Sold]1:[Price Per Unit]3, 0) | Returns the position of the numeric value 42 from the two-column table, where 78 would be 1st position and $20.00 is 6th position | 3 |
=MATCH(DATE(2025, 2, 14), [Order Date]:[Order Date], 1) |
Order Date column is in ascending order. | 1 |
| =MATCH(1500, [Transaction Total]:[Transaction Total], -1) | Returns the position of the closest number equal to or greater than 1500 in the Transaction Total column. The Transaction Total column is in descending order. | 1 |
| =INDEX([Price Per Unit]:[Price Per Unit], MATCH("Jacket", [Clothing Item]:[Clothing Item], 0)) | Returns the value in the Price per Unit column for the row that contains the value Jacket in the Clothing Item column. | 2/20/2025 |
Still need help?
Use the Formula Handbook template to find more support resources and view 100+ formulas, including a glossary of every function that you can practice working with in real-time and examples of commonly used and advanced formulas.
Learn more about formula combinations for cross sheet references.
Find examples of how other Smartsheet customers use this function, or ask about your specific use case in the Smartsheet online Community.