I have come across the following situation a couple of times:
After an experiment has been designed and data collected, the first author of the paper wants to ascertain whether a special analysis would work. So he asks a colleague to help/do this special analysis, which requires significant thinking and effort. Alas, the results are either inconclusive or don't add anything useful to the conclusions of the paper, so they never make it into the manuscript.
Should the colleague who worked hard on the specia analysis but produced no visible output be included as an author? I would think so, but I wonder how others would deal with this situation.