The solution explained below is based on the SUMIFS function.
The values in F4:F9 are text values.
For the range, we use the named rangedate.
For the range, we again use the named rangedate.
As before, we need to concatenate the result from EOMONTH to the logical operator.
Again, the reference to G$4 is mixed to keep the row from changing.
For a side-by-side comparison of formulas vs. pivot tables, see this video:Why pivot tables.