Its not that they are guessing on the age of the earth. Its not a math equation where if you're off by a few numbers the answer its wrong.
Its just that carbon dating, is accurate to billions of years. They have a picture of when the earth was formed. Its fuzzy, but you can make it out. Around 4.5 billion years. They didnt pull that number out of their butt.