Microsoft Excel includes quick stats via Analysis ToolPak; mean, median, and standard deviation are generated for selected ...
Excel already knows when the month ends.
AGGREGATE was built to handle messy data from the start.