Grouping formulas - multiple elseif statements (with AND function) not working - syntax error

Let me start by saying I think this website is phenomenal!

I am trying to use two fields with grouping logic based on two other fields in the data. Both keep coming up with syntax errors and I am not sure if its an operator I am using incorrectly. hopefully something simple.

group1
if op_reportable_group>1000 then ‘+1000’
elseif op_reportable_group_group>=500 and op_reportable_group_group<=1000 then ‘500-1000’
elseif op_reportable_group_group>=300 and op_reportable_group_group<=500 then ‘300-500’
elseif op_reportable_group_group>=100 and op_reportable_group_group<=300 then ‘100-300’
elseif op_reportable_group_group>=50 and op_reportable_group_group<100 then ‘50-100’
elseif op_reportable_group_group>=10 and op_reportable_group_group<50 then ‘10-50’
elseif op_reportable_group_group>0 and op_reportable_group_group<10 then ‘1-10’
elseif op_reportable_group_group==0 then ‘0’ else ‘Error’
end

group2
if bad_search_pct>.75 then ‘+75%’
elseif bad_search_pct>=.50 and bad_search_pct<=.75 then ‘50%-75%’
elseif bad_search_pct>=.25 and bad_search_pct<.50 then ‘25%-50%’
elseif bad_search_pct>=.10 and bad_search_pct<.25 then ‘10%-25%’
elseif bad_search_pct>0 and bad_search_pct<.10 then ‘>0%-10%’
elseif bad_search_pct==0 then ‘0%’ else ‘Error’
end

This trips up everyone. In ruby it’s elsif, not elseif. So many people have run into that so I think I’m going to put in a string replace to fix it soon.

Thanks! it got one of them to work fine… this one is still throwing a syntax error…

if bad_search_pct>.75 then ‘+75%’
elsif bad_search_pct>=.50 and bad_search_pct<=.75 then ‘50%-75%’
elsif bad_search_pct>=.25 and bad_search_pct<.50 then ‘25%-50%’
elsif bad_search_pct>=.10 and bad_search_pct<.25 then ‘10%-25%’
elsif bad_search_pct>0 and bad_search_pct<.10 then ‘>0%-10%’
elsif bad_search_pct=0 then ‘0%’ else ‘Error’
end

Any suggestions?

Adam

nevermind found a ruby parser and it said that the decimals needed 0 in front… that fixed it.

You need ==, not = for equality comparison.