This might sound familiar to you: You’ve been buying coffee every day, and lately, whenever you pay for that steaming cup of pure bliss, you feel a twinge of guilt and wonder whether you should be saving instead. Don’t worry—you are not the first to experience this.

Have you heard of the “latte factor”? It’s the idea of giving up your daily cup of coffee, or similar indulgence, to invest the money you would’ve spent, and over time, your small sacrifice becomes a small fortune. But does it work in practice? Well, yes, but you’d need to start pretty early to make a sizable difference to your nest egg.

Say that a 25-year-old starts saving $5 a day ($35 a week) at an annualized interest rate of 5%. By age 65, this individual will have accumulated almost $230,000 thanks to disciplined saving and compound growth. For some people, this is a worthy endeavour, while others may prefer to enjoy 40 years of sipping their caffè macchiato and socializing with friends and colleagues.

You can also look at the latte factor less literally. Keep life’s little pleasures, such as that daily coffee, but make sure to find other ways to save. Comparison shop. Choose the next best model. The key to success is keeping your eyes wide open for ways to save and making the most of what you save by investing wisely.