Each orbital revolution effectively adds (for retrograde rotation) or subtracts (for prograde rotation) one from the number of sidereal rotations to get the number of apparent solar rotations.
This is easy to demonstrate if you play around with spirographs (or poi, or spinning staffs, or any similar toy involving compound circles). For prograde rotations, you get one less "flower petal" in the spirograph pattern than the number of rotations, and for retrograde you get one more "flower petal" than the number of rotations.
So, the number of solar days is given by the length of the sidereal year divided by the length of a sidereal day, plus or minus one; and the length of a solar day is then the length of the solar year divided by that number. I.e.,
$L_{D-Solar} = \cfrac{L_{Year}}{\cfrac{L_{Year}}{L_{D-Sidereal}}\pm1}$
The intuitive logic behind this formula kinda breaks down if the sidereal day is longer than the sidereal year, though, so you may prefer a slightly different form:
$L_{D-Solar} = \cfrac{L_{Year}L_{D-Sidereal}}{L_{Year} \pm L_{D-Sidereal}}$
This can be derived from the first equation simply by multiplying both numerator and denominator by $L_{D-Sidereal}$. The $\pm$ again indicates retrograde vs. prograde rotation, and negative values for solar day length indicate that the sun appears to move backward, rising in the west and setting in the east.