Do you have an idea of what you want this money to let you buy in 5 years - like an estimated budget for the house?
Okay, the general idea you've read is solid but let me make it more concrete for you. The thing is your bank gives you a nominal rate (say 3% per year), but with inflation eating away at your purchasing power, that 3% isn't really a 3% real gain. To know how much you're *actually* earning, you use the real rate formula: (1 + nominal rate) / (1 + inflation rate) - 1. If your savings account gives you 3% and inflation is at 2%, your real rate is about 0.98% - way less exciting. So for your compound interest with inflation, you can either use this real rate directly in your classic formula (Capital × (1 + real rate)^years), or calculate it nominally and then divide by cumulative inflation.
Here's something practical people often forget: do two scenarios. One where you assume inflation stays stable (say 2% per year) and another that's a bit more pessimistic (3%). That gives you a realistic range instead of false certainty. And honestly, for a house project in 5 years, don't just look at returns - also think about spreading your savings across different products (savings accounts, brokerage accounts if you're comfortable with them): it's more reassuring than putting everything in one place and hoping for compound interest.