here's a worksheet you can use
https://www.thetaxbook.com/updates/TheTaxBook/Client%20Tax%20Tools/S_Corporation_Shareholders_Adjust...