sex - quarrels = x
x > 0 = happy marriage
x < 0 = unhappy marriage
In other words, you should be having sex more often than you quarrel.
The formula was derived from a series of studies in the 1970s. One unpublished study of married students at University of Missouri-Kansas City found that 28 out of 30 self-described happy couples had sex more than they argued, while all 12 self-described unhappy couples argued more. These results were corroborated by a 1974 study by John Howard and Robyn Dawes, in which all 23 happy couples had a positive score and all 3 unhappy couples had a negative score. Two1977 studies offered further confirmation of this idea.
Now it's worth noting that these studies are a few decades old and relied on very small sample sizes, though many of their conclusions square with more recent research. Also, college-aged students who are married are not necessarily an accurate representation of all married couples, and perhaps sex is less important at some stages of some relationships.
Still, it remains a powerful and useful concept.
We came across this formula in "Thinking, Fast And Slow," the 2011 book by Nobel laureate psychologist Daniel Kahneman, in a discussion of the value of simple formulas.