We’ve all heard the maxim that money can’t buy happiness. But remember how happy you were at dinner with friends last week, or watching Star Wars in the cinema, or buying all four of the Elena Ferrante Neapolitan novels? None of that would have been possible without good old money.

Now researchers from the University of Cambridge have confirmed what many may have secretly expected: that there is indeed a link between spending money and happiness. Their study, published in Psychological Science last week, found that life satisfaction increases with spending—but only if people use money in line with their personality type.

The research analyzed more than 76,800 transactions from 625 participants over a period of six months to draw their conclusions. Each transaction was sorted into one of 59 spending categories, which was then rated according to how strongly it’s associated with the big five personality attributes (openness, conscientiousness, extraversion, agreeableness, neuroticism.) The participants took online personality type and life satisfaction tests, and the researchers found that spending varied considerably according to personality type. So, over the course of a year, extroverts spend around $77 more in bars than introverts, and people who are highly conscientious spend around $183 more on health and fitness.

This personality-linked spending is clearly associated with happiness, they found. “Participants who bought products that more closely matched their personalities reported higher satisfaction with their lives, and this effect was stronger than that of total income or total spending,” the researchers wrote in their paper.

However, this study showed only correlation, rather than causality, and the researchers reasoned that the increased happiness could be derived from greater self-knowledge, or another factor. So they conducted a second study, with 79 participants, who were each given $10 and told how to spend it.

The participants took a happiness test before being given the voucher, after receiving it, after using the voucher, and after engaging in the prescribed activity for 30 minutes. And so the researchers could determine that extroverts told to spend $10 at a bar were made considerably happier than introverts given the same activity, while the reverse was true for those sent to the bookstore.

“The results of the experimental study suggest that this effect is causal: Personality matched spending increases happiness,” they wrote.

The authors caution that their data shouldn’t be taken as a how-to guide on spending—accountant fees and home insurance may be rated as suited to introverted people, but spending a great deal on such products is unlikely to make anyone happy.

Overall, the researchers note that their study shows the importance of spending money in a manner that matches personality type. “Finding the right products to maintain and enhance one’s preferred lifestyle could turn out to be as important to well-being as finding the right job, the right neighborhood, or even the right friends and partners,” they write.