You can pass the Item Ledger Entries to Excel with an appropriate filter (like Sales|Purchase) and then create a pivot table on that data.

In the PivotTable, you can then set the Posting Date as value field (in this case the “Posting Date”) to Sum value field by Max and get a list with the corresponding values.

Note that in this case the value field Posting Date is set as Date.
If you need the evaluation more often, as already mentioned, then another solution is recommended.
I can recommend you our app NCE Excel Builder from AppSource, when you need it more often, there you can make the settings once and then create the report and add formulars etc. also without PivotTable function or with - as you like it.
Hope we could help