Voltage divider: Vin - R1 -Vout-R2- Gnd

Vout = Vin *R2/(R1+R2)

Do some rearranging:

Vout(R1+R2) = Vin*R2

VoutR1 + Vout R2 = VinR2

VoutR1 = VinR2 - VoutR2

VoutR1 = (Vin - Vout)R2

VoutR1/(Vin - Vout) = R2

Ex: Vout 3V, Vin5V, R1=10K

3*10000/(5-3) = 15000

check Vout = Vin *R2/(R1+R2)

Vout = 5*15000/(10000+15000) = 3V