简体   繁体   中英

COUNT only one instance between two columns where 3rd column have specific value in EXCEL formula

Please can you help me in excel. I cannot figure it out how to count only one instance where two columns have any value and where 3rd column have specific value like "cat".

Example:

 A |B |C ID540|S3000 |cat =1 A |B |C SD-10| |cat =1 A |B |C |436346 |cat =1

So, if the "cat" is selected then excel goes through A, B and C rows. The sum would be "1".

Any clues ? Big thanks!

You could accomplish this many ways. COUNTIFS or SUMPRODUCT are two ways I can think of off the top of my head. I prefer SUMPRODUCT .

The following formula will return 1 if the A and B columns contain any value, and the C column specifically contains the text cat : (Otherwise, 0 is returned)

= SUMPRODUCT(COUNTA(A1),COUNTA(B1),(C1="cat")+0)

Type this formula into cell D1 and drag down as far as necessary.

EDIT

Based on discussion, formula should be this:

= ((SUMPRODUCT((ISBLANK($A3:$B1002))+0)=0)+0)*((SUMPRODUCT((C3:C1002<>"cat")+0)=0)+0)

EDIT (again)

Based on further discussion, formula should be this: (line break added for readability)

= ((SUMPRODUCT(ISBLANK($A3:$A1002)+0)=0)+0)*
  ((SUMPRODUCT(ISBLANK($M3:$M1002)+0)=0)+0)*
  ((SUMPRODUCT((C3:C1002<>"cat")+0)=0)+0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM