I'm having a problem with this code for nested =IF statement. The range is basically:

<=16 to get 5 pts

16-17 to get 4 pts

17-18 to get 3 pts

18-19 to get 2 pts

above 19 to get 1 pt

and my code is:

```
=IF(D50<=16,5,IF(AND(D50>16,D50<=17),4,IF(AND(D50>17,D50<=18),3,IF(AND(D50>18,D50<=19),2,IF(D50>19),1 ,0))))
```

I think it's correct but it is still showing me errors.

`D50>19`

. – David Zemens May 14 '13 at 15:26