How to Use OFFSET MATCH in Excel: Step-by-Step Guide
In this article
To use OFFSET and MATCH together in Excel, you build a dynamic reference that starts at a known anchor cell, moves a calculated number of rows and columns, and returns a range whose size you control. The MATCH function supplies the row or column position, and OFFSET turns that position into a live range. The result is a formula that keeps working when you add rows, reorder columns, or change the lookup value, without you editing cell references. You do not need any add-ins or special settings, just a worksheet with a header row and consistent data.
What You'll Need
- Excel for Microsoft 365, Excel 2021, Excel 2019, or Excel 2016 on Windows or Mac. OFFSET and MATCH work the same on all of them.
- A table with a clear header row and no blank rows or columns inside the data block.
- A cell where you type the lookup value, for example a product name or an employee ID.
- Basic familiarity with cell references such as A1 and $A$1. The dollar signs matter because they lock the anchor when you copy the formula.
Step-by-Step
- Lay out your data cleanly. Put headers in row 1 and data starting in row 2. For example, A1 holds "Product", B1 holds "Region", C1 holds "Sales". Do not leave blank rows between records. OFFSET counts physical rows, so a blank row shifts every result.
- Choose your anchor cell. This is the top-left cell of your data block, for example A1. You will lock it with dollar signs as $A$1 so it never moves when the formula is copied across or down.
- Write a MATCH formula to find the row. If the lookup value is in E1 and product names are in A2:A100, use =MATCH(E1,A2:A100,0). The zero means exact match. The result is a position number, not a cell address: if E1 contains the third product in the list, MATCH returns 3.
- Wrap that MATCH inside OFFSET. The OFFSET syntax is OFFSET(reference, rows, cols, [height], [width]). To return the Sales value for the matched product, use =OFFSET($A$1,MATCH(E1,$A$2:$A$100,0),2). Here $A$1 is the anchor, MATCH supplies the row offset, and 2 moves two columns to the right to reach column C. Because the anchor is row 1 and the data starts in row 2, the MATCH position lines up correctly.
- Test the result against a manual lookup. Type a value you know exists, confirm the returned number matches the correct row, then type a value that does not exist. MATCH returns #N/A, and OFFSET passes that error through. That is expected behaviour, not a broken formula.
- Return a whole range instead of one cell. Add the height and width arguments. =SUM(OFFSET($A$1,MATCH(E1,$A$2:$A$100,0),1,1,3)) sums three cells starting at the matched row and one column right of the anchor. This is the pattern behind dynamic totals and rolling charts.
- Copy the formula safely. Keep the anchor and the MATCH range locked with dollar signs. If you copy down a column, lock the lookup cell too, for example $E$1, unless you want it to move.
- Check the result with a simpler formula where possible. For a single value, INDEX and MATCH, written as =INDEX($C$2:$C$100,MATCH(E1,$A$2:$A$100,0)), gives the same answer without OFFSET's volatility. Use OFFSET when you genuinely need a moving range, such as the last N rows of a list.
Common Mistakes
- Forgetting the anchor offset. If your anchor is A1 but data starts in A2, a MATCH result of 1 points at row 2 only because OFFSET counts from A1. Anchoring at A2 instead shifts every result one row too far.
- Using relative references. Without dollar signs, copying the formula drags the anchor and the MATCH range out of position, and results silently change.
- Leaving the match type blank or set to 1. MATCH with 1 or -1 requires sorted data and returns approximate matches. Use 0 for exact lookups unless you specifically need a sorted approximate match.
- Counting columns from the wrong place. The cols argument in OFFSET is relative to the anchor, not to the MATCH range. If the anchor is A1 and you want column C, the offset is 2, not 3.
- Ignoring blank rows. A blank row inside the data block makes MATCH return a position that no longer matches the physical row OFFSET counts.
Tips
- Prefer INDEX and MATCH for simple single-cell lookups. It is non-volatile, recalculates faster in large workbooks, and does not break when rows are inserted above the anchor.
- Use OFFSET when you need a range whose size changes, for example the last 12 rows of monthly figures. Combine it with COUNTA to size the range automatically.
- Name your ranges. Selecting A2:A100 and naming it Products makes formulas like =MATCH(E1,Products,0) far easier to read and audit.
- Wrap the formula in IFERROR to show a friendly message instead of #N/A, for example =IFERROR(OFFSET(...),"Not found").
- Keep the lookup column to the left of the values you return, or count columns carefully. OFFSET does not care about direction, but humans reading the formula do.
Troubleshooting
- You see #N/A. The lookup value is not in the MATCH range, or it differs by a trailing space or case. Check with TRIM and confirm the exact text.
- You see #REF!. The OFFSET has moved outside the worksheet, usually because the row or column offset is larger than the sheet allows. Reduce the offset or check that MATCH is returning a sensible number.
- The result is off by one row. Your anchor and your MATCH range start on different rows. Make both start at the same row, or adjust the row offset by the difference.
- The formula is slow. OFFSET is volatile: it recalculates on every change, even unrelated ones. In large workbooks, replace it with INDEX where the range does not need to move.
- Results change after inserting rows. Inserting rows above the anchor moves the anchor. Use absolute references and, where possible, switch to INDEX and MATCH, which tolerate inserted rows better.
Frequently Asked Questions
What is the difference between OFFSET and INDEX?
OFFSET returns a reference built by counting rows and columns from an anchor, and it recalculates constantly. INDEX returns a value or reference at a given position in a fixed range and is not volatile. For most lookups, INDEX and MATCH is the better choice.
Can OFFSET return a whole row or column?
Yes. Leave the height or width argument out, or set it to a large number, to return a full row or column starting at the offset position. For example, OFFSET($A$1,MATCH(E1,$A$2:$A$100,0),0,1,10) returns ten cells across.
Why does MATCH return the wrong row?
The most common causes are a missing exact-match zero, unsorted data when using approximate match, or a MATCH range that starts on a different row from the OFFSET anchor. Check all three before changing the formula.
Does OFFSET work with tables?
It can, but structured references behave differently from plain ranges. For table data, INDEX and MATCH with structured references is usually simpler and less error-prone.
Can I use OFFSET across sheets?
Yes. Put the sheet name before the anchor, for example OFFSET(Sheet2!$A$1,...). The MATCH range can be on the same sheet or another one, but both must be spelled exactly.
Is OFFSET available in Excel for the web and Mac?
Yes, OFFSET and MATCH are standard functions available in Excel for the web, Excel on Mac, and Excel on Windows. Menu labels and ribbon locations can differ slightly by version, device, and region, but the function syntax is the same.