Hi I would reaaly be grateful if anyone can help with providing a code for this.

I have 3 sets of variables relating to the same thing. I was wondering what code I can use to calculate the mean of these variables if the respondents answered at least 2 of them. Many Thanks