I have a spreadsheet with three columns: the names of 261 countries and territories, their respective population counts and the percentage of the world population total that each nation represents.

I'm trying to make a random generator that will produce the name of one of these countries, where the probability that a particular country's name comes up is equal to the percentage of the world population that it represents. For example, China's population accounts for 18.8617605386887% of the world population, so the odds of my generator producing "China" should be 0.188617605386887.

Haven't been able to get it to work, and I've asked a few friends. Any help?