The math doesn't get prettier, but what you are actually doing with your quarters is to shift all date's back by a month and then back by the number of days before the first sunday of that month.
So to calculate the number of days in the previous month, we use: =DAY(DATE(YEAR(A1);MONTH(A1);1)-1)
. This takes the first of this month and subtracts one day and then lets Excel calculate the day-part of that date, which is the number of days in that month.
Next, to shift the number of days back until sunday, we'll subtract a week and add the daynumber of that week, starting with 1 at monday's using: =WEEKDAY(DATE(YEAR(A1);MONTH(A1);1);2)
Finally, after shifting the days, we can compute the quarter just like you suggested: =ROUNDUP(MONTH(A1)/3,0)
.
Now, if you have a date in A1, you can calculate the "Philip Kennedy"-quarter with (and I'll indent it for clarity):
=ROUNDUP( // Regular "roundup for quarter MONTH( A1- // Take the date, but subtract... DAY(DATE(YEAR(A1);MONTH(A1);1)-1)- // ...the days of last month... 7 + WEEKDAY(DATE(YEAR(A1);MONTH(A1);1);2) // ...and the weekdays before sunday ) / 3;0 )`.
Or in one line: =ROUNDUP( MONTH(A1-DAY(DATE(YEAR(A1);MONTH(A1);1)-1)-7+WEEKDAY(DATE(YEAR(A1);MONTH(A1);1);2))/3,0)