Here is an extension to a previous post (https://www.teju-finance.com/forum/firm-valuation/how-to-avoid-bias-when-unlevering-and-relevering-betas) for firms with more complex capital structures. In particular, the file below allows you to unlever and relever the equity beta of firms with debt, equ equity, and preferred stock outstanding.
The corresponding Excel file can be downloaded here.