Performing Excel formulas

if A= 1700 multiply E with CAD_MonthEndRates variable and write in F
elif A= 1800 multiply E with MXN_MonthEndRates variable and write in F
else write the same as E in F
how to write this in excel cells ?

you can use VBA for that.

“=IF(A” + cellIndex.ToString + " = 1700, E" + cellIndex.ToString + ““+ CAD_MonthEndRates+”, IF(A" + cellIndex.ToString + " = 1800, E" + cellIndex.ToString + "” + MXN_MonthEndRates +“,E” + cellIndex.ToString + “))”

I facing one problem in excel
image

Error:The no in this cell is formatted as text or preceded by an apostrophe.

so my formula is not working