How to calculate
Divide the Overworld X and Z by eight to get the corresponding Nether position. Multiply the Nether X and Z by eight on the way back. The target block is found by rounding each scaled coordinate down. Count the border blocks of the rectangular frame and subtract four if leaving out its corners.
Worked example
Use Travel direction Overworld to Nether · Starting X coordinate 800 · Starting Z coordinate -1200 · Outer frame width in blocks 4 · Outer frame height in blocks 5. The result is Nether 100, -150.
Input and result notes
The outer frame includes the border. A 4-by-5 frame uses 10 obsidian without corners or 14 with corners. The target gives a place to look for a usable portal height.