# Trying to add a condition to an IF statement

edited 09/15/23

Hi, all,

I'm trying to combine two statements and I'm getting an invalid data type argument.

Here are the two formulas:

=IF(COUNTIFS({2023 Teams & POs Range 2}, @cell = [PO #]@row, {2023 Teams

& POs Range 1}, @cell = 1) > 0, "yes", "no")

^This formula pulls a value from a checkbox on the 2023 Teams & POs sheet. Right now it's displaying yes/no because it's better than having nothing.

=IF([Project Type]@row = "Standard 2-page case study", -300)

^ If the project type is a 2-page case study, it gets a \$300 discount.

What I'm trying to do is combine the two so that if the checkbox is checked, and the project type is a 2-page study, it gets a \$300 discount. This is my most recent failed attempt:

=IF(AND(COUNTIFS({2023 Teams & POs Range 2}, @cell = [PO #]@row, {2023 Teams & POs Range 1}, @cell = 1) > 0, [Project Type]@row = "Standard 2-page case study", -300))

Any help at all would be appreciated. I've been looking on this board for hours, and have checked the formula handbook as well, and I just can't seem to figure this out. Thanks so much.

• ✭✭✭✭✭✭

You just have a misplaced parenthesis. Move one from the very end to immediately after "case study" so that you close out the AND function before moving on to the output of the IF function.

• ✭✭✭✭✭✭

You just have a misplaced parenthesis. Move one from the very end to immediately after "case study" so that you close out the AND function before moving on to the output of the IF function.

• Oh, my gosh. Thank you SO much Paul!!

• ✭✭✭✭✭✭

Happy to help. 👍️

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!