Returning the Last Value in a variable Row

xcellrodeo

Board Regular
Joined
Oct 27, 2008
Messages
206
Hi everyone,

I have a range of data starting in Row A8 and ending in AL45.
What I am trying to do is to return the last value in each row.
The twist in the matter is that the column within the row to be evaluated varies. i.e
This would represent the range for which I need the latest value to be returned
=INDEX(L9:O9,1,MAX(--(L9:O9<>"")*COLUMN(L9:O9)))

However I am finding that only the lower formula works.
=INDEX(A14:O14,1,MAX(--(A14:O14<>"")*COLUMN(A14:O14)))

Whenever I change A14:O14 to L9:O9, an error message #Ref or #Value is returned.

Can somebody help?
Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
In AM column you could use the following formula copied down:

=LOOKUP(2,1/(A8:AL8<>""),A8:AL8)
 

bosco_yip

Well-known Member
Joined
Dec 2, 2002
Messages
1,940
Office Version
  1. 2019
Platform
  1. Windows
Change this :

{=INDEX(L9:O9,1,MAX(--(L9:O9<>"")*COLUMN(L9:O9)))}

to this :

{=INDEX(L9:O9,1,MAX((L9:O9<>"")*COLUMN(L9:O9)-COLUMN(K9)))}

Or, used Richard Schollar's formula

Regards
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,916
Messages
5,834,363
Members
430,279
Latest member
mkasledge1

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
Top