Q:

Excel Logical Formula for Total when there are two types of null values

I need to make a formula in Excel which sums the values of the previous 6 cells. The complicated part is that if there are only null values, the total should be a hyphen: "-". I got this to work, but then realized there are two possible null values: hyphen and blank. Here is the formula I created for the hyphen as the null value. It worked how I wanted. But then several cells came out with a "0" since they were summing both types of null values.  
=IF(OR(K3 ="-",L3 ="-", M3 ="-", N3 ="-",O3 ="-", P3 ="-"), "-", SUM(K3:P3))

When I realized there were two null values, I tried adding an AND and another OR, but neither got the intended result. 
=IF(AND(OR(K3 ="-",L3 ="-", M3 ="-", N3 ="-",O3 ="-", P3 ="-"), K3 ="",L3 ="", M3 ="0", N3 ="",O3 ="", P3 =""), "-", SUM(K3:P3))

Any ideas on how to get that "blank" value in there?  Thanks!

A:

Try this:
=IF(SUMPRODUCT((K3:P3="-")+(K3:P3=""))=COLUMNS(K3:P3)*ROWS(K3:P3),"-",SUM(K3:P3))

This is effectively counting any cells are numbers. If it is 0, or in other words, if no numbers exist then it returns - else it returns the sum of those values.

Or this more concise formula:
=IF(SUMPRODUCT(1*(ISNUMBER(K3:P3)))>0,SUM(K3:P3),"-")

