Firstly, your idea for using LARGE is correct. An array formula

= IF( MaterialCode=123456, Date )
would return a list of the candidate dates with FALSE for the filtered out dates.

The formula

= LARGE( IF( MaterialCode=123456, Date ), 2 ) ,

committed with

*Ctrl+Shift+Enter*, returns the second last date.

Because the Excel user interface is not really optimised for array formulas you may prefer one of two tricks to avoid CSE. The first is to use a Name to reference the array fragment of the formula, so 'MaterialPurchaseDate' might be defined to refer to

= IF( MaterialCode=123456, Date )
reducing the worksheet formula to

= LARGE( MaterialPurchaseDate, 2 )
Whereas cell formulas evaluate incorrectly when referencing arrays unless you use CSE, a named formula gets it right.

The alternative is to use AGGREGATE to effect the LARGE functionality

= AGGREGATE(14,6, Date/(MaterialCode=123456), 2 )
Here the filtered data generates an error but the AGGREGATE function is set to ignore errors. Because, for me, the AGGREGATE function is difficult to read, I use further named constants so that my (non-CSE) formula reads

= AGGREGATE( LARGE, IgnoreErrors, Date/(MaterialCode=123456), 2 )
The choice is yours