Reputation: 139
Working in Micorsoft Excel, I have a column (L3) that lists different countries, which refers to a variety of project locations, and from these projects, i want to write a piece of code that, in a new column, either categorises the projects location into Region "Sahel", Region "HoA" or leaves if blank if neither of the conditions are met.
For example: I want countries Burkina Faso, Mali and Nigeria to be categoried as Sahel in a new column, I want just South Sudan to be categorised as Horn of Africa (HoA) and the projects listed in other countries to be returned as blank in this respective column.
What I have tried so far:
=IF(OR(L2="Burkina Faso";L2="Mali";L2="Nigeria"); "Sahel";"HoA")
-> This works for the courties I want to categories as "Sahel," however, everything else, and not just South Sudan, is then categoried as HoA, which is not what I want - But I cannot add "" at the end as I then have too many arguments in my code.
I then tried:
=IF(OR(L3="Burkina Faso";L3="Mali";L3="Nigeria"); "Sahel";""); IF((L3="South Sudan"); "HoA";"")
-> But this didn't work out at all...
Thus the end output that I want is
Countries Mali; South Sudan; Mali; Burkina Faso; Somalia; Uganda; South Sudan
For Regions Sahel; HoA; Sahel; Sahel; - ; -; HoA
I hope that soneone can help me move on from here.
Upvotes: 0
Views: 23
Reputation: 26
Use this,
=IF(OR(L2="Burkina Faso",L2="Mali",L2="Nigeria"),"Sahel",IF(L2="South Sudan","HoA",""))
Upvotes: 1