How can I formulate this to achieve the following, I have tried countif formula but getting more confused by the minute.
In cell B23 I want the total number of days A16-A3 but only to count those that have an entry next it in the B column.
So it would in this instance only count from A3: A9 but would update when I put an entry in to B10 the following week.

I tries adapting this but cant get it
=AVERAGEIF(D3:D16,"<>0",D3:D16) which works for B25

gas.JPG