If Statements: Unbalanced Brackets or parantheses

2694
12
Jump to solution
01-10-2024 09:18 AM
EmilySpeck
Occasional Contributor

Hello,

Below is my IF function I am trying upload but I keep getting an error. Error is stating unbalanced parentheses or brackets.

if(selected(${pretype}, 'trash'),'NA'), if(selected(${pretype},'none'),'NA'), if(selected(${pretype},'other'),'${pretype_other}')))))

0 Kudos
12 Replies
DougBrowning
MVP Esteemed Contributor

Yea agreed I posted that several posts before

If these are the only 3 options then can make it even simpler

if(selected(${pretype}, 'trash') or (selected(${pretype},'none'),'NA', ${pretype_other})

0 Kudos
EmilySpeck
Occasional Contributor

Okay I have another issue with IF statements. I am trying to state if the surveyor type '0' mosquitoes in the trap then mark the next question NA. What I currently have is not working. TIA

0 Kudos
DougBrowning
MVP Esteemed Contributor

You need the else part always.  You can just do this with empty string.  You also had the check backwards.

if(${mosnumber} = 0, 'NA', '')

0 Kudos