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
The only way I can see this working is to make a new column. This can be hidden if you want.

Throw this formula in any new column and autofill down:

```
=IFERROR(IF(A1<>INDIRECT("A"&ROW()-1),IF(INDIRECT(CHAR(COLUMN()+64)&ROW()-1)=0,1,0),INDIRECT(CHAR(COLUMN()+64)&ROW()-1)),1)

```

Change A1 as needed to the start of your data. You can also replace the `INDIRECT(...)` with offset but then you have to tell it what column you put the formula in. So to give an example doing it that way; if you put it in column B:

```
=IFERROR(IF(A1<>INDIRECT("A"&ROW()-1),IF(OFFSET(B1,-1,0)=0,1,0),OFFSET(B1,-1,0)),1)

```

This formula gives us a column of 0's and 1's that will tell us either to make the background colored or leave it white.

So in your conditional formatting just apply it to the desired range and use "Custom formula is":

```
=$B1

```

Chose formatting as desired