Return the contents of the second last non empty cell within a column

suprsnipes

Active Member
Joined
Apr 26, 2009
Messages
434
How can I return the contents of the second last non empty cell within a column? Is there a formula I can use?

Regards,
suprsnipes
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Not sure if this is the best way, but it does work.;)

=SUMPRODUCT(LARGE(ROW(A1:AX)*(A1:AX<>""),2))

Change the column letter as needed and change the two X's to a row number guaranteed to be larger than the largest row you ever expect to have data in.
 
Upvote 0
=SUMPRODUCT(LARGE(ROW(A1:AX)*(A1:AX<>""),2))

Change the column letter as needed and change the two X's to a row number guaranteed to be larger than the largest row you ever expect to have data in.
I received the following private message from Marcelo Branco (not sure why he didn't post this directly) which caught an omission with the formula posted. Here is the main part of his message...

Hi Rick,

I *think* you forgot the INDEX part

=INDEX(A1:AX ,SUMPRODUCT(LARGE(ROW(A1:AX)*(A1:AX<>""),2)))
Marcelo was absolutely correct... I concentrated on getting the row number correct that I forgot to plug it into an INDEX function call in order to get the requested contents of the cell. Note that there are now three X's to change.

Thanks Marcelo for catching that!
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

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