Is the IF function strictly to use for numerical tests? For example if I have the following how do I go about it?

A B
1RED IF A1=RED,3,6 IF A1= BLUE 5,9 etc
2BLUE
3ORANGE

I guess i'm a little confused.

Thank you,