On the attached doc is an INDEX formula designed to return the most frequent value in the range A2:A20 that is closest to the bottom of the list.
The list is...
TEESIDE
IPSWICH
QUEENSFERRY
QUEENSFERRY
QUEENSFERRY
QUEENSFERRY
QUEENSFERRY
QUEENSFERRY
QUEENSFERRY
CARDIFF
CARDIFF
CARDIFF
CARDIFF
CARDIFF
CARDIFF
The last one beneath the 6th CARDIFF is a blank.
The formula should return QUEENSFERRY since it is the only most frequent value, and the formula is designed to return A12 corresponding to INDEX(A2:A20,11)
The formula is...
The strange thing is the formula returns 0, which it turns out corresponds to INDEX(A2:A20,19), the blank cell at the bottom.
In the Formula bar, when I select the 2nd argument of the INDEX function then press F9, it calculates out at 11. Also, when I select all of the INDEX formula in the Formula bar, leaving out the leading equals sign, F9 results in "QUEENSFERRY". (C1 in the attached doc has =INDEX(A2:A20,11), and of course it returns "QUEENSFERRY")
Now these results are completely different to results produced in cells. When I copy/paste
into a cell then add the leading equals sign, the cell returns 19 (B2 in the attached doc)
The attached doc shows various stages of the SUMPRODUCT formula and these are consistent with the F9 results shown in the Formula bar. The only difference I can detect is that COUNTIF(Range,Range) in the Formula bar returns a count for the blank cells (4 in this example), whereas the same in-cell array formula does not count blank cells. I don't think this explains the disagreement between the F9/Formula bar results and the cell results.
Is there an explanation for this disagreement between F9/Formula bar and cell results?
Beau Nydal
Bookmarks