Formula Error with IF Fuction

Formula Error with IF Fuction

Hi, 

I want to create formula field to calculate payable amount based on payment terms chosen, when I tried with the if condition, it gave syntax error.

if(${Deals.PaymentTerms}='Quarterly',${Deals.Amount}/4, ${Deals.Amount})

In fact I want to use nested If with Quarterly, Half yearly, Monthly....but since this did not work I tried with simple formula to check syntax error.

if(${Deals.PaymentTerms}='Quarterly',1,2)
But this also gives error.

Syntax Error. Check the examples for any functions you're using to see if you formatted them correctly. Make sure your fields are formatted like this: ${Module Name.Field Name}.

What is wrong in the formula. Please help