I was wondering when someone would cite this: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
But since nobody else seems to have done so, I will. Globally, names don't follow any common format or concept at all that you can reduce to a formula. My takeaway is that it's best to have a free-format "full name" field, and another "preferred name" field so you can allow people to choose how to be referred to.