I have an excel spreadsheet that goes from cell d10 to ai10. Also have 5 possible entries which include: P,A,D,H,J,L which will equal a zero or a one. Only one of these choices will get entered into each cell. I need a function that goes in cell ai that sums number of entries in cells D10 through AH10:

If entry in any cell from D10 to ah10 = P then 1
If entry in any cell from d10 to ah10 = A then 1
If entry in any cell from D10 to ah10 = D then 0
If entry in any cell from D10 to ah10 = H then 0
If entry in any cell from D10 to ah10 = J then 0
If entry in any cell from D10 to ah10 = L then 1. If it happens in 2 cells back to back, then 2. If it happens in more than 2 cells back to back, then 2.

Any help would be much appreciated.