How to we exclude a specific name from a DISTINCT LIST USER formula

Filippo
Filippo ✭✭
edited 06/29/23 in Formulas and Functions

I would like to exclude a specific user name from this formula.

The formula is working fine, and it is returning a distinct list of user names. However, we need to exclude certain users, that are no longer in the group.

For example, how do I say to exclude user "Joe Black" from this list?

=IFERROR(INDEX(DISTINCT({Trial Lead}), [Unique Row ID]@row, 0), "")

Best Answers

  • Genevieve P.
    Genevieve P. Employee Admin
    Answer ✓

    Hi @Filippo

    You can use a COLLECT Function to filter results, for example:

    =IFERROR(INDEX(DISTINCT(COLLECT({Trial Lead}, {Trial Lead}, <> "Joe Black")), [Unique Row ID]@row, 0), "")

    An alternative would be to use a Report and Group by the Trial Lead column, ignoring out the users you don't want by adding them to the filter criteria in the Report.

    Cheers,

    Genevieve

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

    Looks like I missed a closing parenthesis. Sorry about that.


    =IFERROR(INDEX(DISTINCT(COLLECT({Project Lead}, {Project Lead}, AND(@cell <> "Joe Black", @cell <> "Jane Doe"))), [Unique Row ID]@row), "")

Answers

  • Lucas Rayala
    Lucas Rayala ✭✭✭✭✭

    hi @Filippo try this:

    =IFERROR(IF([Trial Lead]@row = "Joe Black", "", INDEX(DISTINCT({Trial Lead}), [Unique Row ID]@row, 0)), "")

  • Filippo
    Filippo ✭✭

    Nice try Lucas. The issue with this formula, is that the data is coming from another sheet.

    The data for "{Trial Lead}" is coming from a different sheet.

    While the "[Unique Row ID}" is a helper column in the same sheet I am working on, to auto-number each row.

  • Genevieve P.
    Genevieve P. Employee Admin
    Answer ✓

    Hi @Filippo

    You can use a COLLECT Function to filter results, for example:

    =IFERROR(INDEX(DISTINCT(COLLECT({Trial Lead}, {Trial Lead}, <> "Joe Black")), [Unique Row ID]@row, 0), "")

    An alternative would be to use a Report and Group by the Trial Lead column, ignoring out the users you don't want by adding them to the filter criteria in the Report.

    Cheers,

    Genevieve

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    edited 06/30/23

    You would need to include a COLLECT function to filter and then an AND function to create the list of users to skip.

    =IFERROR(INDEX(DISTINCT(COLLECT({Trial Lead}, {Trial Lead}, AND(@cell <> "Joe Black", @cell <> "John Smith", @cell <> "Jane Doe")), [Unique Row ID]@row, 0), "")

  • Filippo
    Filippo ✭✭

    @Paul Newcome the formula provided by Genevieve P. above worked, but it is only good to exclude 1 user. If I have to exclude other users, I have tried to implement the "AND function", as you have indicated, but I get an error saying "#INCORRECT ARGUMENT SET". I bet there is something small to adjust.....what do you think I need to correct?

    GOOD Formula for 1 user - need ADD function for multiple users:

    =IFERROR(INDEX(DISTINCT(COLLECT({Project Lead}, {Project Lead}, <>"Joe Black")), [Unique Row ID]@row, 0), "")

    This is the formula that I had tried, but it gives me the error message (#INCORRECT ARGUMENT SET):

    =IFERROR(INDEX(DISTINCT(COLLECT({Project Lead}, {Project Lead}, AND(@cell <> "Joe Black", @cell <> "Jane Doe")), [Unique Row ID]@row, 0), ""))

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

    Looks like I missed a closing parenthesis. Sorry about that.


    =IFERROR(INDEX(DISTINCT(COLLECT({Project Lead}, {Project Lead}, AND(@cell <> "Joe Black", @cell <> "Jane Doe"))), [Unique Row ID]@row), "")

  • Filippo
    Filippo ✭✭

    Works perfectly, thank you Paul and Genevieve!!!

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Happy to help. 👍️

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!