Question: Using this code I can add a class to divs when they get a certain amount of pixels from the top of the browser window. Is it possible to do this using % instead? so I can set it to be 50% from the top? This would mean a uniform effect on all screen sizes...

```
<script>
$(window).scroll(function() {
    $('.names').each(function(){
    var imagePos = $(this).offset().top;

    var topOfWindow = $(window).scrollTop();
        if (imagePos < topOfWindow+350) {
            $('.names').addClass("slideRight");
        }
    });
});
</script>

```

Answer: 
There's a way to do this without adding any extra rows or columns. Make a conditional formatting rule and for the "custom formula" put:

```
=iseven(match($A1,unique($A$1:$A$15),0))

```

The way this works is:

1. `unique` produces the list ValueA,ValueB,ValueC,ValueD,ValueE
2. `match` looks for each value (starting with A1) in that list, note that the search option `0` is required if your values are not sorted. `match` returns the index of the matching value
3. `iseven` applies alternating row coloring based on the matching index
0 / 1
=====

Please try this formula on B1:

`={1;ArrayFormula(IF(OFFSET(A2,,,COUNTA(A:A)-1)<>OFFSET(A2,-1,,COUNTA(A:A)-1),1,0))}`

will add one's when new value in a row occurs.

---

Counter
=======

Next formula will make a counter for values in A:A.

Paste it in C1:

`ArrayFormula(SUMIF(ROW(OFFSET(B1;;;COUNTA(A:A)));
"<="&ROW(OFFSET(B1;;;COUNTA(A:A)));OFFSET(B1;;;COUNTA(A:A))))`

---

Formating
=========

Conditional formatting on range `A:Z` with the following formula: `=isOdd($C1)`

[![enter image description here](https://i.stack.imgur.com/ADxqU.png)](https://i.stack.imgur.com/ADxqU.png)