I can't understand why the OP want a formula to 'find the third'. if he wants a harmony based on thirds BIAB just does it and takes into account the intervals of the scale and key.

why does he need to know that the third of C in the key of C is actually E? how does this help him sing a new harmony part? unless he is laboriously trying to enter a midi melody line which will play the harmony he wants to sing?

i hope i'm not being unkind but somehow there seems a basic lack of music knowledge and BIAB.