Lookup not latest, but second latest value

Joined
Jan 13, 2021
Messages
20
Office Version
  1. 2007
Platform
  1. Windows
Currently I'm using the below formula successfully to bring up a date of a latest left digit in a sequence of two digits:

{=LOOKUP(2,1/("0"=LEFT(C:C,1)),A:A)}

What I want is the same above formula to instead bring up not the last date but the second last date. For example:

April 16, 201813
April 17, 201825
April 18, 201813

Right now, my formula above would bring up April 18, 2018. However, I want it to bring up April 16, 2018... not the last date, but the second last date with a particular left digit.

Please help! Thank you :)
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
This will do it. It would be best to use a fixed range, entire columns can be slow to calculate because of all the empty cells being processed.
Excel Formula:
=AGGREGATE(14,6,A:A/(LEFT(C:C,1)="0"),2)
 
Upvote 0
=AGGREGATE(14,6,A:A/(LEFT(C:C,1)="0"),2)
I tried your formula but all that shows is "#NAME?"

Would there be a way to use my same formula without much editing to get the result I want? Currently my formula works great, the result simply needs to look up the second last date rather than the last one. Thanks.
 
Upvote 0
Which version of excel are you using' if you're getting that error then I'm guessing it must be a really old one?

There is no way of doing what you want with your formula, or any variation of it. Lookup functions can only return first or last match, not things in between. (At least not without making it far more complicated than it needs to be).
 
Upvote 0

Forum statistics

Threads
1,215,155
Messages
6,123,331
Members
449,098
Latest member
thnirmitha

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