By Lydia Warren for MailOnline -- If you're feeling a bit blue, it might be time to move to Utah.

The state has been named the happiest in the country by a new study - while West Virginia has been named the most unhappy.
After comparing 27 different factors including mental and physical health, job security, suicide rates and outlook on life, WalletHub ranked every single state by how happy its residents are.

It concluded that Utah, Minnesota, North Dakota, Colorado and Nebraska are the most content states, while West Virginia, Alabama, Mississippi, Arkansas and Kentucky are the most miserable.

And if you look at a map of the states, residents in the East and the South are generally less content than their Midwest counterparts.

WalletHub, a personal finance social network, ranked each state in three categories to come up with the final list.

The first category was 'emotional and physical well-being', which was determined by 13 factors including life expectancy, obesity, the prevalence of sleep deprivation and suicide rate.

Next there was 'work', which was determined by six factors including commute time, work hours, income level and unemployment.

Finally, they ranked the states by 'community, environment and recreational activities', which was determined by seven factors including weather, number of attractions, safety and divorce rate. 

They then looked at the ranking of each state in these three categories - in Utah's case, it was first in 'community, environment and recreational activities', second in 'work' and 3rd in 'emotional and physical well-being' - to determine which states had scored highest overall.

WalletHub also provided rankings for each of the 27 factors used to determine the results.

Employees in Alaska and North Dakota work the most hours per week, while Utah workers have the lowest weekly median hours in the office.

Utah also has the lowest divorce rate - along with North Dakota and Hawaii - while D.C., Nevada and Louisiana have the most splits.
To make each ranking, the team at WalletHub used information from sources including the U.S. Census Bureau, the U.S. Bureau of Labor Statistics, the Centers for Disease Control and Prevention, Gallup Healthways and Tripadvisor, among others.