Incrementing Values with If Statement
<p><strong>Here is what I am trying to do:</strong></p>

<p>I have data. This data is unstructured and I am trying to make it look neat so that I can do something with it.</p>

<p>There is a column called "Address". If the address column takes the value "ADDRESS" then I want to do a count where the value takes 1. If it is anything other than "ADDRESS" I want the count to increment.</p>

<p><strong>What it currently does:</strong>
My counter takes the value of 1 if the value "ADDRESS" appears, and it increments if the value is not "ADDRESS" but the value does not reset itself. It keeps going as if nothing ever happened. </p>

<p><strong>My code:</strong></p>

<pre><code>var count_y = -1;

for(a = 0; a&lt;= New_Row_Num; a++){
    if(Address == 'ADDRESS'){
        count_y = 1;
        //count_y == 0;
    }else{
        count_y += 1;
    }
}
</code></pre>

<p><strong>What I have tried that did not work other than the code posted above:</strong>
I tried creating an array and assigning it a value of 1. If the "address" column has the value 'ADDRESS' the array goes back to being a value of 1, otherwise the array would increment in value. This had the same effect as above, just with different numbers.</p>

<p>Please help me understand what I am doing wrong, thank you.</p>