Use only parent rows in a referenced sheet

Options

I'm trying to count the number of times a text string is found in a different sheet in columns of the same name, but I only want to count if the name is in a parent row of the referenced sheet. The formula below is #unparseable. What is wrong with it?

=COUNTIF({Sheet1 Names}, CONTAINS(Names@row, @cell), {Sheet1 Names}, count(ancestors(@cell))=0)

Thank you, John

Best Answer

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓
    Options

    A couple of things...

    To have multiple range/criteria sets, you will have to use COUNTIFS instead of COUNTIF. Additionally, hierarchy based functions cannot be used in cross sheet formulas.


    You are going to want to insert a column on the sheet containing the source data, put your

    =COUNT(ANCESTORS())

    there, then reference this new column in your COUNTIFS.


    =COUNTIFS({Sheet1 Names}, CONTAINS(Names@row, @cell), {Sheet1 New Column}, @cell = 0)

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!