"It" or "not it"?

Correct or not correct? Same meaning or not same meaning?

a. This word is used with singular countable nouns to refer to one of a number of things or people, when it does not matter which one.
b. …people, when which one does not matter.

K

As far as I understand you want to insert the word that answers to all these requirements. What comes into my mind first is any but I’m not sure enough

Correct or not correct? Same meaning or not same meaning?

a. This word is used with singular countable nouns to refer to one of a number of things or people, when it does not matter which one.
b. This word is used with singular countable nouns to refer to one of a number of things or people, when which one does not matter.

K