Assuming that your data is formatted as an Excel table, put this formula into B1 and press CTRL+SHIFT+ENTER to make it a range formula.
=MAX(IF(Table1[Pmt]>0,Table1[Date]))-LARGE(IF(Table1[Pmt]>0,Table1[Date]),2)
You would obviously have to substitute the PMT and DATE entries to match the table column headings, and replace "Table1" with your actual table name.
Thanks to @simoco for the inspiration from Given value in column A, find min/max in column B in EXCEL
EDIT
To reference from a different sheet, and to not use a table:
=MAX(IF(Sheet1!$D:$D>0,Sheet1!$A:$A))-LARGE(IF(Sheet1!$D:$D>0,Sheet1!$A:$A),2)
and press CTRL+SHIFT+ENTER to make it a range formula.