find last row value in column when using MATCH to find column

B

Bouce

Hi

I have a problem where I use MATCH to find a column with a specific heading
and then I want to find the last value in the column.
I would like to achieve this just using formulas in the worksheet if possible
All the solutions I have found require the Column letter ("B") instead of a
reference.
My match range does start at column A as 1 if that helps.
Any assistance would be greatly appreciated.
Thanks
 
G

Gaurav

=LOOKUP(2,1/(A1:A65535<>""),A1:A65535)

This will pull the last value in the column.
 
B

Bouce

Thanks, I had found that but I don't have the definite "A" reference, it
could be any column in the range.
 
P

Pete_UK

Your MATCH formula will return the relative position of the cell in
the horizontal range you use. If this number is less than 27, then you
can convert the number to a letter by means of:

CHAR(x+64)

where x is the output from your MATCH formula. Perhaps you can then
incorporate this letter in your formula by means of the INDIRECT
function, along the lines of:

=LOOKUP(2,1/(INDIRECT(CHAR(x+64)&"1:"&CHAR(x
+64)&"65535")<>""),INDIRECT(CHAR(x+64)&"1:"&CHAR(x+64)&"65535"))

Hope this helps.

Pete
 
T

Tom Hutchins

If I understand correctly what you are trying to do, a formula like the
following should work:

=LOOKUP(1E+307,INDIRECT(ADDRESS(1,MATCH("CAT",2:2))):INDIRECT(ADDRESS(65535,MATCH("CAT",2:2))))

In this example, the MATCH functions are looking for the heading "CAT" in
row 2. The LOOKUP function is searching rows 1 through 65535 of that column
for a ridiculously big number (1E+307), and returns the last number found in
the range. If there are no numbers in the range, an error is returned.

Hope this helps,

Hutch
 

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