The formula used to calculate the weighted mean is as follows:

Let’s assume you have two portfolios, an Roth IRA and a Traditional IRA. The Roth IRA has an average expense ratio of 0.15% and a total portfolio value of $7,000, while the the Traditional IRA has an average expense ratio of 0.47% and a total portfolio value of $3,000.
Using these values we can calculate the weighted average expense ratio as follows:

Using an HP12C calculator, we can calculate the weighted average using the following keystrokes:

[.0015][ENTER]
[7000][Σ+]
[.0047][ENTER]
[3000][Σ+]
[g][x-bar w]
This formula is commonly used to calculate the weighted average expense ratio of a portfolio of investments.