The chemical formula for a diamond is simply C. Diamonds are carbon atoms arranged in a specific way. Graphite and soot also have chemical formulas of C because they are carbon atoms, like diamonds are, just in different arrangements of molecules.
Diamonds, graphite and soot are allotropes of one another. They have the same chemical formula, but they have different physical properties and look different. Diamonds do not conduct electricity well and take on a crystalline form. Graphite, on the other hand, consists of carbon atoms arranged in hexagonal layers. An electric current can run through graphite. Soot does not have a structured form.