Google-sheets – Counting unique values based on multiple columns

google sheetsworksheet-function

I am working in Google Spreadsheets and trying to do some counting that takes into consideration cell values across multiple cells in each row.

Here's my table:

   |AUTHOR|    |ARTICLE|        |VERSION|   |PRE-SELECTED|   
    ANDREW      GOLF STREAM          1          X
    ANDREW      GOLF STREAM          2          X
    ANDREW      HURRICANES           1      
    JOHN        CAPE COD             1          X
    JOHN        GOLF STREAM          1  

Each person can submit multiple articles as well as multiple versions of the same article. Sometimes different people submit different articles that happen to be identically named (Andrew and John both submitted different articles called "Golf Stream").

Multiple versions written by the same person do not count as unique, but articles with the same title written by different people do count as unique.

I am looking to find a formula that

  • Counts the number of unique articles that have been submitted (without having to manually create extra columns for doing CONCATS, if possible)

It would also be great to find formulas that:

  • Count the number of unique articles that have been pre-selected (marked "X" in "PRE-SELECTED" column)

  • Count the number of unique articles that have only 1 version

  • Count the number of unique articles that have more than 1 of their versions pre-selected

Best Answer

I know this is an old topic, but for the number of unique articles, this might work:

=ArrayFormula(counta(unique(filter(A2:A&B2:B, len(A2:A&B2:B)))))

I also tried to work out some formulas for the other questions:

enter image description here

Hope this helps ?