title: Excel coding: how to categorise data and reach 1 of 3 possible outputs
body: <p>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 &quot;Sahel&quot;, Region &quot;HoA&quot; or leaves if blank if neither of the conditions are met.</p>
  <p>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.</p>
  <p>What I have tried so far:</p>
  <pre><code>=IF(OR(L2=&quot;Burkina Faso&quot;;L2=&quot;Mali&quot;;L2=&quot;Nigeria&quot;); &quot;Sahel&quot;;&quot;HoA&quot;)
  </code></pre>
  <p>-&gt; This works for the courties I want to categories as &quot;Sahel,&quot; however, everything else, and not just South Sudan, is then categoried as HoA, which is not what I want - But I cannot add &quot;&quot; at the end as I then have too many arguments in my code.</p>
  <p>I then tried:</p>
  <pre><code>=IF(OR(L3=&quot;Burkina Faso&quot;;L3=&quot;Mali&quot;;L3=&quot;Nigeria&quot;); &quot;Sahel&quot;;&quot;&quot;); IF((L3=&quot;South Sudan&quot;); &quot;HoA&quot;;&quot;&quot;)
  </code></pre>
  <p>-&gt; But this didn't work out at all...</p>
  <p><strong>Thus the end output that I want is</strong></p>
  <p><em><strong><strong>Countries</strong></strong></em> Mali; South Sudan; Mali; Burkina Faso; Somalia; Uganda; South Sudan</p>
  <p><em><strong><strong>For Regions</strong></strong></em>   Sahel; HoA; Sahel; Sahel; - ; -; HoA</p>
  <p>I hope that soneone can help me move on from here.</p>