When you only need two outcomes, the IF function is fine. But the moment you start stacking conditions (if this, then that, otherwise if this, then that), you’re building a house of cards. At first, ...
The best way to do this is by converting your data to an Excel table. Select your data range (A1:E11), press Ctrl + T, and click OK. Excel names it something like "Table1"; in my case, it's Table3, ...