Yes, of course. I have cyclothymia, anxiety and anorexia but have nearly always been able to work.
It's only the most severe cases that cannot work at all in my experience.
However, I think it's very dangerous to say things like 'yes, because I have to.' or 'yes, because there's no choice.' A lot of posters have said this and it makes it sound like they are stronger than those who can't work and that, if circumstances demand it, anyone could push their MH condition aside and just cope.
That just isn't the case. Depression and other mental healthy conditions do not respect the fact that you are a single parent, need rent money, need to care for other family members etc. At a certain severity of illness a person will break down regardless of the need to keep going. That isn't their fault and the consequences can be horrendous (homelessness, children going into care etc).
Just because you think you have to keep going doesn't mean you have the physical ability to. It's not superior strength, it's luck/less severe illness.
Severe mental illness isn't limited to those with the time, money and freedom to succumb to it.