How do we determine whether a substance is pure in a chemical formula ?

If we write the formula how can it be anything but pure (unless we have two formulas written together).