Zend certified PHP/Magento developer

Count cells in a column between values until specific value reached in Google Sheets – Multiple Criteria

I am trying to do a tricky conditional count on a dataset. I need to count the number of rows that meet a set of criteria (after a specific date, a certain category) that sums up to a set limit – that is, I am counting how many days between now until the sum of the “Forecast” is a certain value.

enter image description here

So in this instance, I would want to count up the # of forecast rows that were = Category 1, Date starting 12/27, until the Forecast column sums less than or equal to $20,000. The desired answer would be 5.