How the number is worked out
The four walls are two pairs of rectangles, so the gross area is 2 x (length + width) x height. Doors and windows come off at their real sizes - a standard leaf and a standard casement are prefilled, and you can change both. The ceiling is optional, because half of the people measuring a room are not painting it.
The result is multiplied by the number of coats before it is divided by the spread rate, and the tin count rounds up. Running out two thirds of the way along a wall means a visible lap mark where the new tin starts, even when the colour code is identical.
The spread rate is the number that actually varies
Everything else here is geometry, and geometry does not argue. The spread rate does: the same paint covers a primed wall and bare plasterboard very differently, and the figure on the tin assumes the good case. If you are painting new board, take the bottom of the range rather than the middle.
Openings larger than the wall
If the door and windows add up to more than the wall area, the calculator says so instead of returning zero. That combination is always a typo - usually a window entered in inches while the room is in feet - and silently answering “no paint needed” would be the least helpful thing it could do.