The message "cannot mix aggregate and nonaggregate arguments with this function" usually appears when there are fields in a calculated field that are aggregated and not aggregated. Looking at the formula, it may be possible that [required shipping date] is not aggregated. Please try to change the formula to the following. Note that I have aggregated [required shipping date].
datediff('day',max([Customer Delivery Date]),max([Require Shipping Date]))
Furthermore, just because the formula is valid, does not mean it will give the calculate the expected values. If this does not resolve the issue, calculations are very dependent on how the format of the data is and what is on the view. Would it be possible to get a copy of the workbook?