Being happy is not an exact formula — earning a lot of money does not necessarily equate to a happy life.

A new survey by InterNations, the world’s largest network for people who live and work abroad, shows that this is the case for expats across the globe.

The company asked 14,300 people living overseas, representing 174 nationalities and living in 191 countries or territories, to rate 43 different aspects of life abroad on a scale of 1-7.

One of the sub-indexes looked at personal happiness.

Some of the countries that made the top slots showed that the happiest expats across the globe were not necessarily earning a huge amount, nor were they in places that had the best infrastructure. But something about living in these countries satisfied them.

Take a look at the top 17:

17. Portugal —The country ranks in the top 5 "dream destinations" for expats, according to the survey. It is particularly popular for people emigrating with children.

16. Oman — Expats going to this country usually move with a job already secured. Once they are there, many say good personal safety (57%), political stability (46%), and peacefulness (62%) all contribute to a happy life.

15. Kenya —The country is becoming increasingly popular with expats, thanks to job growth in various sectors, beautiful surroundings, incredible weather, and a low cost of living.

Giraffes browse at the Ol-Pejeta conservancy in Laikipia county, approximately 200 kilometres north of the Kenyan capital, Nairobi on July 8, 2016. (Getty)

14. Peru — The survey says that Peru mainly attracts business owners, so expats who already have an income. Many relocate for the weather and low cost of living.

13. Hungary — Hungary is one of countries that climbed the most in the personal finance index, meaning that people are earning more. This has contributed to the the personal happiness of expats as costs have not risen in line with earnings, making it a cheap place to live.

(iStock (iStock)

12. Uganda —The east African nation has transformed itself into a country of relative stability and prosperity and this is attracting expats from across the globe looking for emerging market opportunities.

11. Taiwan — The country features near the top of many sub-indexes and expats in Taiwan are "relatively well-off despite low absolute income." Access to quality healthcare and education also makes expats happy there.

Tourists taking photos at Xiangshan or Elephant Mountain with the Taipei 101 seen in the background in Taipei, Taiwan (EPA)

10. Spain — Accommodation, food and drink, and transport cost very little in comparison to Western European countries such as Britain. Combined with job prospects, decent pay, and good weather, expats rate this as one of the places they are most happy with.

Barcelona's Barceloneta beach (Getty)

9. Panama — The country is a hive for service economy jobs, including finance and infrastructure. Pay goes a long way and the good weather does not hurt.

8. Vietnam — The popular expat destination for Western Europeans scores highly because you can live pretty decadently on a low wage (by Western standards). There is also incredible scenery, activities and places to explore.

Vietnam has extended visa-free travel for Brits (Shutterstock)

7. Thailand — Another favourite destination for the Western world is Thailand, where low cost of living, easiness of settling in, and activities make expats very happy.

Monkeys eat bananas at an ancient temple during the annual 'monkey buffet' in Lopburi province, north of Bangkok, Thailand (ge)

6. New Zealand — The country may be out of the way but peacefulness, good healthcare, and good education all contribute to expats saying they are extremely happy there.

Motorhome, RV, travelling near the snowcapped Mount Cook/Aoraki Mountain Range, South Island, New Zealand (iStockphoto)

5. Ecuador — The country fell 16 places in the quality of life index, but in terms of personal happiness, expats say it's one of the best places in the world for a happy life. Cost of living is low and weather and activities are abundant.

(Getty (Getty)

4. Philippines — Those with families rank the country highly thanks to a friendly attitude towards children and low cost of living.

Manila, capital of the Philippines, is going glam with new openings from Paris Hilton and Donald Trump (AFP/Getty)

3. Mexico — The country ranks number one in the ease of settling in index, as well as highly across the weather and friendliness sub-indexes.

(Reuters)

2. Malta — The country is a favourite destination for Europeans looking to relocate, thanks to the ease of settling in, low language barrier, low cost of living and enviable weather. Interestingly, the survey shows that personal happiness is one of the best because 70% of expats in Malta surveyed are in a relationship, compared to the global average of 63%.

1. Costa Rica — The country is one of the top 5 "dream destinations" for expats in the survey and makes people happy from all different walks of life — 19% are entrepreneurs or business owners, 20% have a part-time job, while 14% are retirees.

Costa Rican Beach: (Getty Images/iStockphoto) (Getty/iStock)

Read more: