Not sure what is the data behind the formula, however if you point to one cell only as below, it will give you the count of times that value exists in A1:A19.
=SUMPRODUCT(--(A1:A19=G1))
G1:G3 will not work as the array elements are not matching
Hey Friends.... I some how managed to get the required result by creating an helper column....but can someone explain as to what does the SUMPRODUCT(--( means, I mean how do sumproduct(--(A1:A10=B1)) gives us the count.
the -- refers to double negation. The portion (A1:A10=B1) returns only TRUE & FALSE values, where as SUMPRODUCT is meant to work with numbers. So by adding two negative symbols --, you are forcing excel to convert boolean (logical) values to numbers. So TRUE becomes -1, false becomes 0 after the first - symbol. The second symbol, negates and gets you a bunch of 1s & 0s, which the SUMPRODUCT then sums up.
Read up this for more: http://chandoo.org/wp/2009/11/10/excel-sumproduct-formula/