To be honest, I’m not quite sure, but I have a vague memory of a really successful developer mentioning something like this:
“I was just about to build a 30 floor skyscraper when a builder told me I’d be better off building 16 floors and spread the building out in answering how many floors is the most cost effective.”
So could this be right? 16 floors? Well. I don’t think there is an answer. It all comes down to how valuable the land is and what you are allowed to build on it. If you have a really valuable address you want to build as high as possible to maximize the living space you can sell. If you have a huge property and can build as big as you want, you would probably be better by spreading the building out sideways, keeping it to one or two floors.
To summarize, there is no general answer to how many floors is the most cost effective. Every address must be looked at individually before an assumption can be made.