Find latest date based on entry in other column

In the sample sheet I have 3 columns. Tasks, Date, Completed. In B3 I use the formula =MAX(B5:B20) to find the latest date. In column C I marked the tasks already completed with “ok”. Want to modify my formula to find the latest date not completed.
Maybe combining =Max and =FILTER where C5:C20 <> “ok” but am unable to construct.

Date.ods (12.1 KB)

You may use SUMPRODUCT as a filter
.
Without testing

=MAX(
      SUMPRODUCT( C5:C20<>"ok"; B5:B20 )
      )

Compare to this case:

or using a more specialized function:

=MAXIFS(B5:B20;C5:C20;"<>ok")
1 Like

Thank you for the solutions. The version with SUMPRODUCT throws an error which I did not evaluate further. MAXIFS does what I want. Formula solved.