Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Countifs to not include blank cells with formulas I am trying to count the cells

ID: 3571071 • Letter: C

Question

Countifs to not include blank cells with formulas I am trying to count the cells in my spreadsheet that have a date based on another cells criteria. The dates come from a vlookup formula. Column B has a vlookup formula to pull a date, if no date then a blank. Column A lists all the cities. I want to count the dates in column B if the city is Toledo. I am currently using =COUNTIFS(A2:A1117,"Toledo",B2:B1117,"<>"). I think this would have worked fine but it is counting the cells that are blank because of the formula in the cell. The total count should be 390 but is totaling 759 which would count for all the cells for Toledo not just the ones with a date. What do I need to change in my formula to count only the visible dates?

Thanks !!

Explanation / Answer

Hi,

SUMPRODUCT can handle that.

=SUMPRODUCT((A2:A1117="Toledo")*(B2:B1117<>""))