How to Find the Position of a Value in Excel?
Discover how to locate a value's position in a list and use it to retrieve data from a different column effortlessly.
Formula Genius can generate a draft from a plain-English prompt. Supported formulas can be checked with sample cases; review the coverage on the result.
The formula
"Find the position (row number) of a value in a list, then use that position to return a value from a different column"
=INDEX(B:B, MATCH(A1, A:A, 0))
This formula finds the row number of a specified value in one column and returns the corresponding value from another column.
Step-by-step breakdown
- MATCH(A1, A:A, 0) finds the row number of the value in cell A1 within column A.
- INDEX(B:B, ...) uses the row number found by MATCH to retrieve the value from column B.
- The '0' in MATCH specifies that an exact match is required.
- This formula assumes that the data is in two columns, A and B.
Edge cases & warnings
- The value in A1 does not exist in column A.
- Column A or B contains blank cells.
- Multiple occurrences of the same value in column A.
- The data ranges are not of equal length.
Examples
"A1 = 'Apple', A:A = {'Banana', 'Apple', 'Cherry'}, B:B = {'Red', 'Green', 'Yellow'}"
'Green'
"A1 = 'Cherry', A:A = {'Banana', 'Apple', 'Cherry'}, B:B = {'Red', 'Green', 'Yellow'}"
'Yellow'
Frequently asked questions
What happens if the value is not found?
The formula will return an error (#N/A) if the value is not in the list.
Can I use this with non-contiguous ranges?
No, the ranges must be contiguous for the INDEX and MATCH functions to work correctly.
Is this formula case-sensitive?
No, the MATCH function is not case-sensitive by default.
Can't find what you need?
Describe a formula in plain English. Formula Genius drafts and explains it, and can check supported formulas on sample cases.