Find the Last Value in a Column of Array Formulas

DavidWF

Board Regular
Joined
Oct 14, 2015
Messages
130
I currently use
Code:
=LOOKUP(2,1/(1-ISBLANK($AB:$AB)),$AB:$AB)
to find the last value in col AB where I have manually entered the cell values.

I just tried to use the same formula on another worksheet but on this sheet every value in col AB is the result of an array formula. The =LOOKUP formula is returning a blank, even though col AB has thousands of values in it. On both sheets col AB is a mix of numeric values and blank cells, the difference being that on the sheet where I manually enter data the blank cells are truly blank, whereas on the second sheet the blank cells contain an underlying formula that hasn't returned a numeric value.

I'm guessing that the blank output is because of the array formula. How should I amend the =LOOKUP formula to work with the array data?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
gaz_chops - that worked perfectly!

arthubr - the first formula under #001 worked perfectly, as did the first formula under each of #002 and #003 .

Brilliant! - four different ways of solving the problem and I hadn't previously thought of any of them :oops:

arthurbr, that web site is very interesting, I've book-marked it for future reference. I currently colour-code cells on another worksheet, depending on the result of the particular row, and I've had it in the back of my mind that one day I'm going to want to count and/or sort the rows based on the coloured cells. That web site will be a great guide for me when I finally decide to attack that issue.

My grateful thanks to both of you for solving my immediate LOOKUP problem.
 
Upvote 0
Thanks Phuoc, that also works, so that's now five different ways to resolve my problem. You guys rock!!
 
Upvote 0
Sorry, but the gremlins have struck!

I'm currently implementing the above recommendations on two worksheets. On one worksheet the output from each of the five alternative formulae gives the expected result:
https://1drv.ms/u/s!ArANX3rGwxC6bG3iLJScJV_8iYs

On the other worksheet I get a zero value output, regardless of which of the five formulae I use:
https://1drv.ms/u/s!ArANX3rGwxC6bQEP1T0laA2HhRI

The formulae I've used are:

=LOOKUP(10^35,$AB:$AB)

=LOOKUP(2,1/(1-($AB:$AB="")),$AB:$AB)

{=INDEX(AB:AB,MAX(IF(ISNUMBER(AB1:AB65535)*(AB1:AB65535<>""),ROW(AB1:AB65535))))}

=LOOKUP(9.99999999999999E307,AB:AB)

=INDEX(AB:AB,MATCH(9.99999999999999E307,AB:AB))

Any thoughts on why each formula should work on one sheet but not work on another virtually identical sheet will be very much appreciated.
 
Upvote 0
Thanks Phuoc - the issue is now solved.

I tried your formula but got the same result - a zero.

I was puzzled why so many different formulae were failing to give the expected result when those same formulae worked fine in other locations so I started to probe a bit further. I eventually found a block of data/formulae several thousands of rows down the sheet, with multiple cells displaying a zero. I have absolutely no idea how this block came to be down there, but deleting the 6000 rows immediately below my active data area on the sheet solved the issue.

Your formula worked fine once those rows had been deleted.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top