Countif function for Even and Odd numbers
John C <johnc@stateofdenial wrote...
I am quite literate, and know the words of robust, and robustness.
Ooops, I deleted your formula, now it gives no answer.
But, according to you
...It'll NEVER return a wrong numeric result no matter how users torture or misuse
the workbook...
Yup, so it doesn't give the WRONG answer. Apparently the concept that
NO answer is equal to NEITHER a right answer nor a wrong answer has
yet to enter your oh, so literate mind. Literate perhaps, but still
ignorant.
To repeat in the vain hope of penetrating your simple mind, no answer
isn't a wrong answer. It's no answer.
And of course, the best one you said:
...It always works unless ...
Well, another flip flop
Ah, logic! Rather the lack of it.
You're now explicitly resorting to 3-year-old's arguments. I could say
the sun will rise tomorrow, and you will say either that the sun could
explode or the earth stop rotating before that. Do I really need to
preface my statement that IF ANY OF US SURVIVE TO TEST THIS, the sun
will rise tomorrow? Knowing you, you'd then posit the earth
transported into some region between galaxies with billions of alien
spaceships pointing heat lamps at earth in order to construct a
scenario in which some of us do survive but the sun doesn't rise.
I wonder what you'll come up with next.
...This isn't (OK up to MOD's standars)...
OK, if you require it, up to MOD's standards *AND* assuming users
don't deliberately or accidentally clear or delete cells containing
formulas, or change their system fonts, or delete necessary DLLs, or
corrupt their registries, or remove necessary subsystems like video
cards/chips, or damage hardware, or gouge out their eyes or chop off
their fingers.
You first state that the formula isn't OK. Which, in fact, it is OK. I agree
that it isn't as robust as other solutions, but it IS OK. . . .
It's OK if the range contains no numbers with fractional parts.
Probably OK if the data in the range comes from an outside system that
only records integers. Less likely OK if the range contains formulas.
Now, you say that the formula could be improved upon. . . .
As in made more general - yes. It could be improved upon by being made
more general. OTOH, someone else who will remain nameless improved
upon it under the assumptions the range would only contain integers,
namely,
=SUMPRODUCT(MOD(x,2))
. . . But to say the formula didn't work / meet the OPs required
needs was obviously wrong on 'your' part. . . .
The original formula works when all entries are integers. That
satisfies the OP's specs. However, as I mentioned before, newsgroup
archives serve as FAQs, and the original formula doesn't work in
general. Neither did the other formula, count of even numbers, if
there could be text or blank cells in the range.
So if the range in question consisted of integers only < 2^28, then
both original formulas in this thread give the correct results. But if
there were anything else in the range, both formulas could return
incorrect numeric results. Generalizing the count of even numbers was
dealt with in a different branch, so I didn't mention it.
you keep posting to this one as well, so obviously it matters somewhat to you.
Unlike you, I wasn't foolish enough to state, 'and that's pretty much
all I'm gonna waste on this'. You lack self-discipline too? Or just
enjoy affecting insincere faux-principled positions?
|