this is not a good way because
... you took the wrong construct: if an If
with else is specified, it works - what else do you expect? Possibly you want something like
In[2]:= xx = 3;
For[i = 1, i < 2, i++,
qq = Which[xx == 4, 54, xx == 5, 55, xx == 3, 57, xx == 7, 58, True, 59]
]
In[4]:= qq
Out[4]= 57