IF AND formula

Christine Menke
edited 01/31/23 in Formulas and Functions

Hi Experts,

I'm using below function in column "Model count" which works fine,

=IF([helper column]@row = MIN(COLLECT([helper column]:[helper column], [Model Number]:[Model Number], @cell = [Model Number]@row)), 1)

but I would like to add another check upfront. If (Article dev type)@row is NOT "CO", than it should use the above formula otherwise put in a 0.

I tried this but I get below error:

=IF(AND([Article Development Type]@row <> "CO", [helper column]@row = MIN(COLLECT([helper column]:[helper column], [Model Number]:[Model Number], @cell = [Model Number]@row)), 1, 0))

not sure what's wrong.

Thanks for your help!



Answers

  • Debbie Sawyer
    Debbie Sawyer ✭✭✭✭✭✭

    I think you just have a bracket in the wrong place.

    =IF(AND([Article Development Type]@row <> "CO", [helper column]@row = MIN(COLLECT([helper column]:[helper column], [Model Number]:[Model Number], @cell = [Model Number]@row))), 1, 0))

    Have you tried adding 1 more bracket before the ,1 and removing 1 bracket from the end?

    Good luck!

    Debbie

  • Debbie Sawyer
    Debbie Sawyer ✭✭✭✭✭✭

    Thats great news :D

    Getting the brackets in the right place is something I always need to check carefully! Even after years of writing formulae! Smartsheet are good though, as they colour code their brackets so you can see which close bracket relates to which open one. I find that helpful!

    Glad this worked for you.

    Kind regards

    Debbie

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!