Thanks, Biff. Why didn't I think of +0? Still not getting used to Boolean.
Since I am a fan of SUMPRODUCT, I'll throw in this.
=SUMPRODUCT(ISERROR(B1:B13+0)*(B1:B13<>"")/COUNTIF(B1:B13,B1:B13&""))
Wonder if it is more efficient than array SUM(IF( ......
Epinn
T. Valko said:
I just want to share with you what I have found.
That's a good point, numbers formatted as TEXT.
=SUM(IF(ISERROR(VALUE(B1:B13)),(B1:B13<>"")/COUNTIF(B1:B13,B1:B13&"")))
=SUM(IF(ISERROR(B1:B13+0),(B1:B13<>"")/COUNTIF(B1:B13,B1:B13&"")))
Biff
Let me share with you my test. I know you use a different data set than the
one listed.
Using the data set you posted, sometimes I get 9 and sometimes I get 8. The
"culprit" is 6 in row 7. It all depends on how it is entered.
If I format a blank cell (never used) as text then key in 6, I will see the
green triangle (V. 2003) and ISTEXT is TRUE. Result = 9.
If I key in 6 to a blank cell (general format), then format as text, ISTEXT
is FALSE. Result = 8.
This is not new to me and I know that if I rekey 6 and hit enter, ISTEXT
will be TRUE.
When I read the request (first post), I wasn't sure how to interpret row 7
of the data set. 6 is a number but it is left aligned. So, I interpreted
it as text and didn't want to test for ISTEXT.
Finally, I came up with the following array formula (Ctrl+Shift+Enter) which
should ignore numbers regardless of how they are entered. The result is 8
for both of the above cases.
{=SUM(IF(ISERROR(VALUE(B1:B13)),(B1:B13<>"")/COUNTIF(B1:B13,B1:B13&"")))}
If your numbers are in general format and/or number format, then ISTEXT will
be fine.
Mind you, I am no expert. I just want to share with you what I have found.
Epinn
OK, now I find that the formula results are 1 too many. I hand counted,
twice, and got 55 and the formula result is 56. Could that be coming from
the Frequency function? (The data array having 1 more element than the bin
array.)
Mike F