Hi there!
Since you are using Excel 365, you have access to some powerful dynamic array functions that make this very easy. The best approach depends on whether your data is already sorted by date or not.
Here are the two best solutions for your request, assuming your data is in columns A...