Very nice,

xld I was wondering what Am I doing wrong here

=IF(N13<>0,SUM(E7:E507),SUMPRODUCT(--(E7:E507=(MID(E7:E507,2,1)="1")),E7:E507))
thanks