Number of values for a correlation, in a correlation matrix

Hi

I am calulating a correlation matrix from a dataset full of holes and I would like to know on how many values the correlation was calculated from.

In other words I would like to know how many records show the same pair of properties, for each pair of properties of my dataset.

I've found an extremely circonvoluted way of doing this with a ridiculously high calculation cost so I am quite certain I'm doing it wrong.

Anyone has a clue?

Thanks