Searching from the bottom up

jnagel

New Member
Joined
Jul 10, 2011
Messages
6
Hello,

I have a list which cycles through an order of numbers:
eg.

0
1
2
3
0
1
2
3
etc.

I want to be able to determine the row number of the last 0. Is there a way to search up from the bottom?

Thanks in advance for your help!
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hello,

I have a list which cycles through an order of numbers:
eg.

0
1
2
3
0
1
2
3
etc.

I want to be able to determine the row number of the last 0. Is there a way to search up from the bottom?

Thanks in advance for your help!
Try this...

Book1
ABC
20_6
31__
42__
53__
60__
71__
82__
93__
Sheet1

Formula entered in C2:

=LOOKUP(2,1/(A2:A9=0),ROW(A2:A9))

Assumes no empty cells within the range.
 
Upvote 0
If your data was in column A you can Find starting bottom up using Find with A1 and xlprevious, ie

hth

Dave

Code:
Sub BottomUp()
Dim rng1 As Range
Set rng1 = Columns("A").Find("0", [a1], xlValues, xlWhole, , xlPrevious)
If Not rng1 Is Nothing Then MsgBox rng1.Row
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,629
Members
452,933
Latest member
patv

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