Yes, such a formula exists:
RGB Luminance value = 0.3 R + 0.59 G + 0.11 B
Background
Human eyes don't detect brightness linearly with color. Basically, we see Green as brighter than Blue. So, the term Luminance was invented, which is brightness adjusted to indicate appropriately what we really see.