Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

recovering the cell address of a vlookup statement

Tags:

excel

vba

is there a way to get address_of(vlookup(.....)) ??

where address_of = "A25" (or something in that format) ??

like image 595
Alex Gordon Avatar asked Sep 17 '10 20:09

Alex Gordon


People also ask

How do I return a cell address in Excel?

The Excel ADDRESS function returns the address for a cell based on a given row and column number. For example, =ADDRESS(1,1) returns $A$1. ADDRESS can return an address in relative, mixed, or absolute format, and can be used to construct a cell reference inside a formula.

Can Xlookup return cell reference?

XLOOKUP can only return a reference to a single cell, row or column, not a whole table consisting of multiple rows and columns. It's also only available to Excel for Microsoft 365 users.

Can VLOOKUP return a cell value?

Besides returning value in an adjacent cell, you can vlookup and return value in the next cell of the adjacent cell in Excel.


2 Answers

=ADDRESS(MATCH(60,A1:A12,0),1)

Missed out the ,0 making it approximate and not an exact match. This is not good for drop downs combo menus; if two things can be the same, then you need an exact match or it picks up the last one.

like image 169
Dez Avatar answered Sep 30 '22 13:09

Dez


Use MATCH() rather than Lookup. The formula below assumes you've got a lookup table in A1:A12.

It looks for the value "60" and turns the returned row index into a textual range address (e.g. "$A$6").

=ADDRESS(MATCH(60,A1:A12,0),1)

The third parameter in MATCH() makes this an exact match.

like image 39
Marc Thibault Avatar answered Sep 30 '22 11:09

Marc Thibault