title: Excel Create a IF statement that produces a value of 1 in Excel column
body: <p>I am attempting to code a script that runs in excel. I currently have an excel file with over 1,000+ State initials in one column, for example, NJ, MI, OH, TX. With that being said, I have 3 other columns that represent regions A, B, and C.</p>
  
  <p><a href="https://i.stack.imgur.com/R6Rwx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R6Rwx.jpg" alt="Image of Excel Document"></a></p>
  
  <p>If the state initial is NJ, I'm trying to return the value 1 in the specific corresponding region column. For instance, if the state initial is NJ return 1 in the corresponding column and row (Region B). If the state initial is TX return 1 in the corresponding column and row (Region A). And if the state initial is Ontario return the value 1 in (Region C), and so on. </p>
  
  <p>Does anyone have any idea how I can complete this task? Using VBA, python, whichever language​ that will get it done the best.</p>
  
  <p>Also please see attached picture for a better understanding. The code below is my attempt to do one state at a time. </p>
  
  <pre class="lang-vb prettyprint-override"><code>Sub Region()
      If Range("A:A").Value = "NJ" Then
          Range("C:C").Value = 1
      End If   
  End Sub
  </code></pre>