The goal is to calculate the number of missing 2nd and 4th sundays, and how much refund is required depending on the end of the billing cycle based off the x months.
Cell A:=IFERROR(MOD(MONTH(D2) - 1, VALUE(H2)), 0)Cell B: =J2/H2*A2