If Apple sold itself for $1 trillion in cash, the money would be enough to buy all the goods and services produced in Indonesia — population 261 million — in 2017.
Apple is bigger than the economies of about 174 countries, including Turkey, the Netherlands, Saudi Arabia and Switzerland.The first sentence is kind-of all right. You could use $1 trillion to buy all of the goods and services produced in Indonesia in 2017 (but why would you want to?). The second sentence is an example of one of my pet peeves. Apple is NOT bigger than the economies of about 174 countries. It's not even bigger than the example of Indonesia from the article. And it's easy to see why. If investors are rational, Apple's market capitalisation represents the discounted value of all future cash flows for Apple. So, you would be effectively selling off all of the future cash flows of Apple for all time, in order to get just one year's worth of Indonesia's GDP. Clearly, Apple is worth a lot less than the economy of Indonesia.
The problem (as I've mentioned many times before, such as here and here and here) is comparing stocks with flows. The size of an economy (as measured by GDP) is a flow of resources for a single year. Apple's market capitalisation is a stock (a measure of its total value), not a flow for a single year. The appropriate stock for a country is the discounted value of all future GDP, not one year's worth of GDP. If you want to compare Apple with the size of an economy, you would need to compare Apple's market capitalisation with a much bigger number for each country.