Here's how it works
If there were no such thing as staging tracks on a modern layout, then the yard size would be determined by totalling up all the industry storage capacity on your layout, doubling that number, and then designing a yard with that capacity. (The ideal is a yard that's never more than 50% full, since it's the easiest to switch.)
But with staging involved where trains can originate and/or terminate "offstage" then the dynamics are all different.
My upcoming editorial and article on layout design by formula will somewhat address this question. But in the meantime, here's some guidelines.
GUIDELINES ON DETERMINING YARD SIZE
First, determine how many trains (total cars) will originate from staging and terminate in the online yard. Then determine how many trains (total cars) will originate in the online yard and terminate in staging. Then determine how many total cars will originate from the online yard and go to online industries (industries on the layout). Finally assume a car-for-car swap at online industries - while 50 cars may go out, assume 50 cars will return as well.
If all these cars were in the yard at the same time then the yard would need to handle this total number of cars. Let's say your train length is 20 cars and you determine the following:
1. 5 trains (100 cars) will originate from staging and terminate in the online yard.
2. 4 trains (80 cars) will originate from the online yard and terminate in staging.
3. 50 cars will originate from the online yard and go to online industries, and 50 cars will return from industries.
That means the yard needs to hold 230 cars (100+80+50) worst case. However, all these cars will not be in the yard at once. My rule-of-thumb would be to design the yard so that the 230 cars, if they were all in the yard at once, would fill it to 80% (which is clogged and hard to switch, but not impossible).
This means 230 divided by 0.8 or 288 cars is how large the yard capacity I'd shoot for.
More likely at any given time, you will have a lot less than 288 cars in the yard, more likely only 150 cars or so max, which will leave the yard at around 50% full, making it very easy to switch.
However, this is ideal. If you want to compromise, then drop the yard down below 288 cars. If you go back to 230 cars, then 150 cars in the yard will put it at 65% full and it will be harder to switch because there will not be as much free trackage for maneuvering. If you drop to 200 cars for the yard size, then 150 cars would put the yard at 75% full, which is approaching clogged levels.
RULE OF THUMB, NOT AN ABSOLUTE
These concepts and figures are a rule-of-thumb and not absolutes. The more runaround tracks, switching leads, wyes, turntables, and other trackage you provide for maneuvering and turning equipment, the easier it will be to switch a smaller, more full yard.
Finally, keep in mind the mainline to yard trackage ratio on most model railroads (especially with modern staging trackage) means the mainline's ability to roll trains will push the ability of the yardmaster to keep up. So anything you can do to make sure your online yard has plenty of room to switch and maneuver, the more the yardmaster will appreciate it.