Generate number of array values based on value of another field

What is the best way to accomplish this?

If Field1 = “ABC” then Field2[1]
If Field1 = "EFC then Field[2]

Thanks for your help!