another COUNTIF question

A

Adam

can the count if questions cont rows that have two different inputs in
different columns?

I need to count rows in which any of the columns in that row contain two
distinct values. So basically i need code this, Count the number or rows
that contain A AND B, in any of its columns.

Is that possible?

Thanks,

-Adam
 
T

T. Valko

If this is related to your other post where you say you have 1000's of rows
of data take the easy way:

Use a helper column and enter a formula like this on each row then copy down
to the last row:

=(COUNTIF(A4:D4,"A")>0)*(COUNTIF(A4:D4,"B")>0)

Then just get the SUM of the helper column.

If you want a single "brute force" formula:

=SUMPRODUCT(--(COUNTIF(OFFSET(A4:D13,ROW(A4:D13)-MIN(ROW(A4:D13)),,1),"A")>0),--(COUNTIF(OFFSET(A4:D13,ROW(A4:D13)-MIN(ROW(A4:D13)),,1),"B")>0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top