Forget all that horse manure about sanctifying your relationship before God and in the presence of your loved ones. The real, practical value of the institution of marriage is that it’s a stress test: if your relationship can survive planning the wedding, you’ll probably make it to the finish line.

Of all the many nightmares involved in this dreaded process, drawing up the guest list may be the worst. Do it in public, like Harry ‘n’ Meghan, and there’s not just cousin Mavis’s private butthurt to worry about but the rubbing in of the fact that Barack Obama, Donald Trump and Theresa May are NFI’d. There are six categories of guests that can cause real difficulty:

People you’re related to, but who you hate

You’re supposed to invite these ones. It’s kind of the form. Don’t be like the bride I know who caused all sorts of difficulties by asking her husband to uninvite his father on the eve of the wedding. And if you have a big family, you have to be very careful about picking and choosing cousins: branches of families tend to come as a package. If there are relatives you really, really can’t stand, the trick is to invite them, then take revenge with the seating arrangement.

People you like, but you can’t afford to invite

This is less likely to apply, obviously, when one of you is a prince and the other a Hollywood star. But that gives you less wriggle room, too. If you’re both only moderately off, and you’re paying for it yourself, less close friends will (mostly) be understanding if they get a tier two, come-for-a-drink-afterwards-but-not-the-three-course-dinner invitation. That’s harder to do if that friend is a world leader. Why is South Korea invited to dinner while the DPRK only gets pints and stovies, the North Korean ambassador might wonder? International incidents have started over less.

People one of you likes, but the other hates

The number one cause of all premarital rows, and the subject of intense horse-trading. Is it his boorish old drinking buddy who is guaranteed to #MeToo a bridesmaid or crack a vile joke to her father the vicar? Or is it her overemotional schoolmate, who will dominate the karaoke before bursting into tears and making it all about her? Former lovers are a particularly tricky subcategory. “But she’s not just my ex, we’re like, really close friends now.” Or: “OK: write down which of these Cressidas you haven’t banged, right now, or the wedding is off.”

People you both like, but who hate each other and are likely to Create A Scene

It isn’t just exes of the bride and groom who can cause trouble. In any large and longstanding friendship group, there will be personal and romantic tensions. What do you do when your big group of pals from your early 20s contains, say, Mark Zuckerberg and the Winklevoss twins? Or Brad and Jennifer? Or Iran and Israel?

People you don’t know that well, but who are a bit famous and so add glamour

Again, a different case if you, the bride and groom, are a bit famous and bring the glamour yourselves. But even if the general idea is to gather together only people who are special to bride and groom, there can be a distinct temptation to use a wedding to shape the friendship group you wish you had, rather than reflect the one you do. But if there’s a one-in, one-out policy, you have to decide between the exciting new friend against the old but boring one who you haven’t seen for a couple of years, but who will still take grave offence if they are not invited.

People you like, but whose partners are awful

You pretty much have to suck this one up. Unless you’re going to have a blanket no-husbands-and-wives rule, you risk a metaphorical (or, in a royal wedding, a literal) third world war scenario if you explain to someone, however delicately, that you don’t have capacity for plus ones. And a blanket no-partners (or no blanket-partners) rule can cause even more trouble than that. Let’s not even start on whether their children are invited. Remember: five dear friends can quickly turn into 20 or more unwelcome guests.

Is there a way around all this? Not if you’re determined to get married, there isn’t. The best you can hope for is the goodwill of those friends who, having been through it themselves, know that you can’t always get it right. If Harry and Meghan don’t invite me, for example, I shall be gracious about it. I know that it’s my wife they can’t stand.

• Sam Leith is an author, journalist and literary editor of The Spectator