0

I am reporting the accumulative count of dates that appear in Column for each month for a year (eg 2018). I have used a COUNTIFS function to exclude the cell from the count if there is an 'x' next to it in Column B.

=COUNTIFS($B:$B,"<>x",$A:$A,"<="&EDATE(D1,0))

It works perfectly but for future months that haven't occurred yet (eg Sept, Oct, Nov, Dec) I need the formula to return "0" or blank. See attached example sheet.

I have tried to nest the COUNTIFS in an IF(AND) formula but it just doesn't want to work! I keep getting a ERROR value. SUMPRODUCT doesn't appear to work either.

Accumm COUNTIFS Test Sheet.xls

1
  • Instead of a Google Drive link, please edit your question to include a text example of data you might see in your spreadsheet. See this question for a good example. Commented Aug 23, 2018 at 1:25

1 Answer 1

0

I have added a date condition below stating for column A to be less than the first of next month based on what is in column D:

=COUNTIFS($B:$B,"<>x",$A:$A,"<"&EOMONTH(D1,0)+1)

With a same calendar year constraint:

=COUNTIFS($B:$B,"<>x",$A:$A,"<"&EOMONTH(D1,0)+1,$A:$A,">=" & DATE(YEAR(D1),1,1))

Perhaps try:

=IF(TODAY()>EOMONTH(D1,0),"",COUNTIFS($B:$B,"<>x",$A:$A,"<"&EOMONTH(D1,0)+1,$A:$A,">=" & DATE(YEAR(D1),1,1)))

If you already have future dates in the sheet.

Sign up to request clarification or add additional context in comments.

3 Comments

Thankyou for your response but I am still receiving the accumulative count of the previous months in the future month fields for Sept, Oct, Nov and Dec. I need these fields to show "0" until dates are added for those months in Column A (in the future). I have updated my original post with the link to the Example sheet.
They should appear as 0 because they fail "<"&EOMONTH(D1,0)+1 test. Nothing would then be summed. Can you please show some data including an example that fails. Unless, you have the dates already present but no data in the field? In which case you can't use the date field to restrict future entries. Is there a field which is always populated historically but is never populated in advance?
Thankyou! The final formula using IF(TODAY()... function works as I need it to! I have edited it slightly to the below as it doesn't need the calendar year constraint. =IF(TODAY()>EDATE(D1,-1),COUNTIFS($B:$B,"<>x",$A:$A,"<"&EOMONTH(D1,0)+1),0)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.