Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Finding Nth earliest (oldest) date from list, date is partial string

I’m looking to get the Nth oldest date from a list of text strings. The data looks like the following:

Date
100% (05/29/2024)
100% (11/08/2022)
100% (03/28/2022)
100% (11/08/2022)
100% (10/25/2022)
0%
25% (05/29/2024)
100% (08/25/2022)
100% (10/25/2022)

The result, if N = 1, should be the oldest date or 03/28/2022. If N = 3 the result should be 10/05/2022.

I’m aware of the function SMALL() and MID() but I’m not sure how I can combine these two while also only looking for those fields that have dates. Only those that are >0% will have dates included, but only those at 100% should be evaluated.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Maybe try:

=IFERROR(INDEX(SORT(--REGEXEXTRACT(A1:A9,"^100% \((\d\d\/\d\d\/\d{4})\)$")),1),"No Value")

That way you’d only pull the dates when a string starts with ‘100%’ and follows the rest of the correct input’s pattern. Here the ‘1’ is your ‘N’. Just change it as desired.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading