need vlookup function to return the row number

S

skiing

I have a one column list of data (around 3,000 items) - and I am using
the vlookup function to determine if an item is in that list using
something like the formula below:

=if(iserror(vlookup(A1,D1:D3000,1,false)),"not in list","in list")

I would like to know if I can have this function return the cell
address or row number to indicate the location of the item in the list
- is this possible?

Thank you for your time and assistance
 
D

Dave Peterson

Use =match() instead.

=if(isnumber(match(a1,d1:d3000,0)),match(a1,d1:d3000,0),"No match")

=match() will either return an error (if there's no match) or it'll return an
index into the range. Since your range starts in D1, it'll be the same as the
row.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top