Find last value in a row or column

PeterBain

New Member
Joined
Jul 22, 2017
Messages
17
Office Version
  1. 365
How do you display the last value in a row of cells selected?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Welcome to the forums!

In VBA?

Try:

msgbox selection.cells(1,selection.columns.count).address
 
Last edited:
Upvote 0
Thanks you for the quick reply. I was hoping there was a formula I could use rather than <acronym title="visual basic for applications" style="border-width: 0px 0px 1px; border-top-style: initial; border-right-style: initial; border-bottom-style: dotted; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: rgb(0, 0, 0); border-left-color: initial; border-image: initial; cursor: help; color: rgb(51, 51, 51); background-color: rgb(250, 250, 250);">VBA</acronym>
 
Upvote 0
Try:

=LOOKUP(2,1/(NOT(ISBLANK(1:1))),1:1)

This will return the value of the last populated column in row 1.
 
Upvote 0
Thank You. Should I just change the row Reference (1:1) for each row?

This is what my data looks like. There is VLOOKUP formula in each cell getting the value. I need to get the last value

1ABCDEFGH
222/7/201729/7/20175/8/201712/8/201719/8/201726/8/20172/9/2017Last Value
3 28 29 30 32
4 32 32 33 35 36 32 30
5 30 30

<colgroup><col width="25" style="width:19pt"> <col width="77" style="width:58pt" span="2"> <col width="69" style="width:52pt"> <col width="77" style="width:58pt" span="3"> <col width="69" style="width:52pt"> <col width="75" style="width:56pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
Another option...
Excel Workbook
ABCDEFGH
222/07/201729/07/201705/08/201712/08/201719/08/201726/08/201702/09/2017Last Value
32829303232
43232333536323030
5302828
Sheet5
Excel 2010
Cell Formulas
RangeFormula
H3=INDEX(A3:G3,MATCH(9.99999999999999E+307,A3:G3))
H4=INDEX(A4:G4,MATCH(9.99999999999999E+307,A4:G4))
H5=INDEX(A5:G5,MATCH(9.99999999999999E+307,A5:G5))
 
Upvote 0
Thank you again.

That works. Except I had to change the ; to , otherwise it kept thinking it was text.

It works perfectly! Thanks for all your help.
 
Upvote 0
Thanks you Mark858. Your formula works perfectly too.

I now have two great solutions.

I'm sure I'll be back with some more questions as I'm trying to build an Excel solution to a very manual process where users have used their discression in making decisions and now want it automated.

Thank you again.

Peter
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,575
Members
449,039
Latest member
Arbind kumar

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