last non-blank cell, column to left

orsm6

Active Member
Joined
Oct 3, 2012
Messages
496
Office Version
  1. 365
Platform
  1. Windows
Hi everyone. could someone help me please with a formula? trying to get last non-blank cell in column B then look left to column A and return value of next row down.

so if B20 was last non-blank cell, would like to return value in A21.

TIA.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Try:
=INDEX(A:A,MATCH(LOOKUP(2,1/(B:B<>""),A:A),A:A,0)+1)
 
Upvote 0
Since you didn't indicate where the result should go, I have put it in a message box.

VBA Code:
Option Explicit

Sub Orsm()
    Dim lr As Long, ans
    lr = Range("B" & Rows.Count).End(xlUp).Row
    ans = Range("B" & lr).Offset(1, -1)
    MsgBox (ans)

End Sub
 
Upvote 0
Since you didn't indicate where the result should go, I have put it in a message box.

VBA Code:
Option Explicit

Sub Orsm()
    Dim lr As Long, ans
    lr = Range("B" & Rows.Count).End(xlUp).Row
    ans = Range("B" & lr).Offset(1, -1)
    MsgBox (ans)

End Sub

Hi Alan - thanks for the reply, needed a formula not a VBA.

cheers.
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,597
Members
449,038
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