How to get max date < today from list

Environment:
OS: Mac OS X Lion 10.7.5 (11G63)
LO: Version: 4.3.7.2

/Before anyone is saying, please update first:
I am forced to be in an older version of LO (I can't update MacOS any
further on the hardware, so I can't update LO either).
Hence I do not have MAXIF() or MAXIFS() available./

I am having a list of music (identified by numbers) sang or planned to sing
in tab '2018'
In another tab (in my case 'Last') I want to show the latest date the number
is sung. Of course if the date in the list is in the future I don't want to
show that..

I tried
{=MAX(IF(AND(A3='2018'.E1:E100;'2018'.B1:B100<TODAY());'2018'.B1:B100))}
This provides the wrong answer...

How can I accomlish what I want?

See 'Last'.B3

&lt;nabble_a href=&quot;TestMuzLijst.ods&quot;>TestMuzLijst.ods

Hi,

If you can sort your data, you can use the "MATCH()" function to look
for that date. If column "A" contains the dates sorted in ascending
order, this formula will return the latest date which is less than
"TODAY" (if you remove the "-1", then it will be for less than or equal
to "TODAY"):

=INDIRECT(ADDRESS(MATCH(TODAY()-
1;OFFSET(A2;0;0;COUNT($A:$A);1);1)+1;COLUMN($A$1)))

If you cannot sort your data, there are ways to do a sort on another
sheet using formulas and then using the formula above will yield the
information you are looking for.

I hope this helps.

Rémy.

Hello,

After considering your question, I think my answer was a bit insufficient. I
have attached a file to this post which does what I think you want. The
first sheet contains a list of items with a date that should correlate to
your music number/date sang, in no particular order. The second page sorts
the entries and extracts the "last date" for a piece ID provided on the
first sheet. I am using a French locale, so you may need to change the date
formats to yours to make the date display work.

If the upload link does not work, I will send the file directly to your
personal e-mail.

I hope this helps.

Rémy.
DateSorting.ods
<http://document-foundation-mail-archive.969070.n3.nabble.com/file/t489793/DateSorting.ods>