Using Join collect from referenced sheet while ignoring criterion

Deonizia Egan
Deonizia Egan ✭✭✭✭
edited 10/21/24 in Formulas and Functions

=JOIN(COLLECT({Prime Student Onboarding Worksheet Rate Total}, {Prime Student Onboarding Worksheet School}, School@row, NOT(CONTAINS("SIP",{Prime Student Onboarding Worksheet Affiliate}@row))), CHAR(10))

trying to get this formula to work while ignoring cells in the rate total column that have a hyphen (this is formula driven text). I have been all through the community discussions and tried <>"-", tried making that a "" instead, tried using not(has, and many other options.

Since the Affiliate row text SIP is what determines the hyphen in the total column I am now attempting to ignore anything that has SIP in that column and I am STILL coming up with incorrect argument. everything is giving me incorrect argument.

Hope someone way smarter than me can help. :)

Tags:

Best Answer

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    The only issue is the range inside of the CONTAINS function. It should simply be "@cell" (without the quotes).

    NOT(CONTAINS("SIP", @cell))

  • Deonizia Egan
    Deonizia Egan ✭✭✭✭

    I tried it that way and it still didn't work. I tried just @cell (incorrect argument set), @row (bad syntax), or with the reference row mentioned as above. :(

    @cell (incorrect argument set)

    =JOIN(COLLECT({Prime Student Onboarding Worksheet Rate Total}, AND({Prime Student Onboarding Worksheet School}, School@row, NOT(CONTAINS("SIP", @cell)))), CHAR(10))

    @row (bad syntax)

    =JOIN(COLLECT({Prime Student Onboarding Worksheet Rate Total}, AND({Prime Student Onboarding Worksheet School}, School@row, NOT(CONTAINS("SIP", @row)))), CHAR(10))

    with reference column (incorrect argument set)

    =JOIN(COLLECT({Prime Student Onboarding Worksheet Rate Total}, AND({Prime Student Onboarding Worksheet School}, School@row, NOT(HAS({Prime Student Onboarding Worksheet Affiliate} = "SIP")))), CHAR(10))

    this is my original working formula:

    =JOIN(COLLECT({Prime Student Onboarding Worksheet Rate Total}, {Prime Student Onboarding Worksheet School}, School@row), CHAR(10))

    it produces this cell data

    does it matter if the data "SIP" is coming from a vlookup?

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    The @cell would work, but it looks like you added an AND function in there for some reason. If you remove that along with the associated set of parenthesis and have it follow the appropriate syntax for the COLLECT function (range, range, criteria, range, criteria), it should work.

  • Deonizia Egan
    Deonizia Egan ✭✭✭✭

    this?

    =JOIN(COLLECT({Prime Student Onboarding Worksheet Rate Total}, {Prime Student Onboarding Worksheet School}, School@row, NOT(CONTAINS("SIP", @cell))), CHAR(10))

    I am now getting an invalid operation error.

    Also, can you help me understand to what Cell the "@cell" is pointing? how does it know what column to look in if the column isn't one of the options in the formula?

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

    You are missing the range where SIP would be found.

    You have

    range, range, criteria, criteria

    You need

    range, range, criteria, range, criteria

    The @cell tells the CONTAINS function to evaluate the previously established range (the one in bold above) on a cell by cell basis.

  • Deonizia Egan
    Deonizia Egan ✭✭✭✭

    WOW! ok. that was way easier than I was trying to do. I tried about a million things and was probably just a little bit off each time. 😝 Thank you! it is fixed.

  • Deonizia Egan
    Deonizia Egan ✭✭✭✭

    UGH! Now I tried to use the same formula to gather the same criteria data off another column and i get incorrect argument again! Bolded is the ONLY thing I changed (new reference column from same referenced sheet as before)

    =JOIN(COLLECT({Prime Student Onboarding Worksheet Student}, {Prime Student Onboarding Worksheet School}, School@row, {Prime Student Onboarding Worksheet Rate Total}, NOT(CONTAINS("-", @cell))), CHAR(10))

    I did change up the location for the "not(contains" because apparently not ALL of the "-" corresponded to SIP after all. but it works in the original formula

    =JOIN(COLLECT({Prime Student Onboarding Worksheet Rate Total}, {Prime Student Onboarding Worksheet School}, School@row, {Prime Student Onboarding Worksheet Rate Total}, NOT(CONTAINS("-", @cell))), CHAR(10))

    so now I just need to pull the student names.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!