I was told that is ok to use
何でもないが欲しいです。
in an informal setting for "I don't want anything."
Is this correct? And what is an expression I can use in a formal situation?
Japanese Language Stack Exchange is a question and answer site for students, teachers, and linguists wanting to discuss the finer points of the Japanese language. It only takes a minute to sign up.
Sign up to join this communityI was told that is ok to use
何でもないが欲しいです。
in an informal setting for "I don't want anything."
Is this correct? And what is an expression I can use in a formal situation?
If the scenario were saying "I don't want anything" in response to someone offering you something (food, drink, etc.), you could also use
(私は)[結構]{けっ・こう}です。 → I'm fine/all right.
何でもないが欲しいです would mean 'It's nothing, but I want it.' Honestly it makes very little sense. You seem to have taken 何でもない as a noun, but really it's a full phrase meaning 'It's nothing.' To say you don't want anything, I think 何も欲しくない would work (though I'm probably wrong). It would be a little more natural to say 何も要らない 'I don't need anything', though, I think. Formally you could say 何も要らないです or 何も要りません.
In formal way: 申{もう}し訳{わけ}ありませんが何{なに}も欲{ほ}しくありません。 / 申{もう}し訳{わけ}ありませんが何{なに}も要{い}りません。
In informal way: 何{なに}も欲{ほ}しくない(よ)。 / 何{なに}も欲{ほ}しくないんだ。 / 何{なに}も要{い}らない(よ)。
Postscript
何も要らない is better than 何も欲しくない, which is written in Nothing at all's answer.