Yeah, it calculates the average proportional value. So, if you add 10 swordsmen with 15k experience to 100 swordsmen with 2k experience (for example), the result will be (15k*10 + 2k*100)/110 = 3181 experience for the new unit. In general, it's quite simple. If this system is further developed and properly implemented, it could be very useful.
Let's say it works like that. How do you combine improved and unimproved units?
Added 1 minute ago
I'm in favor of bringing back azure and similar units.