cpburke94
cpburke94

Reputation: 1277

What formula would I use to count values in one cell, but only if another cell is blank?

Trying to get a count based on cells in two different columns - I want to count all cells in column A that have a value, but I only want these values to be counted if there is no value in a cell in column B Ex. of what this would look like in Excel: A2 = 2020-08-19, B2 = *B2 is blank

Current formula is below, just returns a FALSE. I've also tried a few variations of COUNTIFS, but can't seem to get it right.

=IF(ISBLANK(B2:B6),COUNTIF(A2:A6,"*"))

Upvotes: 0

Views: 3982

Answers (1)

Scott Craner
Scott Craner

Reputation: 152505

Blanks get difficult with COUNTIFS, as an empty string("") is different than a true blank to COUNTIFS, I would use SUMPRODUCT:

=SUMPRODUCT((LEN(A2:A6)>0)*(LEN(B2:B6)=0))

Upvotes: 2

Related Questions