All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Working in a company's share section in calculating profits from Riba (interest and/or usury) and doing the inventory for it is not permissible as this is authenticating Riba contracts and helping in it.
However, if the share section is free from calculating and writing down the Riba profits (i.e. interests), then it is permissible for you to do it and your salary in this field is lawful.
The fact that most companies are not free from Riba is not a sound reason for working in Riba and helping in it. You may indeed work in a section that has nothing to do with Riba transactions even if the salary is lesser. What is lawful is abundant [there is blessing in it] even though it is a small amount and what is forbidden is small [no blessing] even thought it is a big amount. Allaah Says (what means): {Say, “Not equal are the evil and the good, although the abundance of evil might impress you.” So fear Allaah, O you of understanding, that you may be successful.}[Quran 5:100]
On the other hand, if the company’s activity is lawful but it might be that it borrows money with Riba or that it deposits its money in Riba-based banks, then it is not forbidden to work for it in what is lawful as it is permissible to deal with a person whose money is a mixture of what is lawful and what is forbidden. What is important is that the work in itself should be lawful and the majority of the activity of the company should not be in what is forbidden.
Finally, if a person is obliged to stay in a forbidden job in order to get his sustenance and that of his family, then he is excused according to the necessity until he finds another job and he should endeavor to find it.
Allaah Knows best.