E = IR. There is no fixed formula for your application, as you don't indicate what current you wish to flow. Using fixed resistors means that the actual voltage changes with the load. Or you could get a 7812 regulator.
One equation with two variables, bad news. As beenthere says, you need to specify current. Any current flowing out via 12V will cause the voltage to change. If the current out from the divider is much less than the current flowing through R1 and R2, then it can work. You will have a lot of power loss as you bring the resistances down to accomplish this. This is only practical for high impedance inputs, although the temperature can effect the circuit.