This is a machlokes Rishonim. It is brought in the Ran to the Rif's Hilchos Chanuka, first paragraph.
The Ran first proves and then defends the opinion that it cannot be used even for mitzvah purposes, and then cites the Baal HaMe'or that you could use it for mitzvah purposes. The Ran's primary proof is that they allowed the use of inferior oils for Shabbos lighting because you won't be using them for personal use, and if mitzvah use was allowed, that should create the same issue of coming to tilt the candle to improve the light. He then addresses what could be support for the other opinion, that the Gemara specifically points out a non-mitzvah use, counting or checking money, when disallowing use, and the Ran says that is to point out even such a minimal use is still not allowed.
The Mechaber in O.C. 673:1 cites the opinion that it is not allowed, and then cites the opinion that it is allowed as a "some who say"
ואפילו לבדוק מעות או למנותן לאורה אסור ואפילו תשמיש של קדושה כגון ללמוד לאורה אסור ויש מי שמתיר בתשמיש של קדושה