Zend certified PHP/Magento developer

INDEX with array formula is giving different results than INDIRECT with ADDRESS when used by COUNTA

The following sheet illustrates the problem:

enter image description here

I want to know if there is any non-blank cell in a range, but once the sheet is autogenerated, I can’t refer to this range directly (B3:B5). It is relative to some column.

Due to performance reasons, I want to use the INDEX function instead of INDIRECT, but when I pass the INDEX result to COUNTA, I am getting 3 non-blank cells when I just have 2.

Why COUNTA(INDEX($1:$24, {3;4;5}, 2)) gives a different result than COUNTA(INDIRECT(ADDRESS(3, 2) & ":" & ADDRESS(5, 2)))?