Realistically... if you had the resolution of the screen and the actual monitor dimensions (inside dimensions vertical and horizontal) then you could do a straight ratio conversion.
For example, my resolution is 1680x1050 but I don't have an actual measuring tape handy to tell you the height and width of the "viewable space" of my screen. It's claimed to be a 22" 16:9 ratio screen though so some mathematics would be able to get you there.
The thing is, if you ask just for the "monitor size" that doesn't take into account the variables of whether it's standard size, wide screen, ultra-wide screen... You'd need to at the very least know the 'size', ratio and resolution setting to be accurate in this.
Dunno if that helps or just confuses the issue further :)