in reply to If statement not working

I don't see any "light pink" color. The code is not efficient, but it is not horrific. Your question appears to be about the logic of the statements rather than the efficiency.

Under normal UI processing, the use of "elsif" would make no practical difference. Please further clarify what you desire.

Update: show some data and explain clearly "why it is not working". Use of "elsif" or hash tables don't seem to go to the point. Please explain why these simple "if" statements are not working for you.