It really depends on a lot of factors. If its an existing building, get your utility bills out for the last several years and figure out your yearly usage in Kilowatt Hours (KWh). With a new house you do not have the bills so you need to fill in some details on the ranch. Is it an energy efficient home?. If you build a Passivhaus or Pretty Good House which are both the high end in energy efficient you pay more up front but the yearly energy costs are much lower with minimal heating and cooling that normally is covered with surplus net metered solar (yes even in Detroit). Also inportant is how good is your solar exposure. Ideally you need a lot that is facing south with minimal shading from 8 AM to 4 PM. Having a roof pitch roughly equal to your latitude 42 degrees in Detroit. That is capecod roof pitch, with a ranch you need more roof space and more panels to deal with less than optimal pitch. If you go with ground mount you can set the panels to optimum angle but on flat land shading can be a bit more of issue. We would also need to know if you want hot water heating, air conditioning and heating covered by the system. A new home would have a heat pump hot water heater and cold climate minisplits with some sort of backup for very cold conditions where a minisplit is marginally efficient or outright unable heat the place.
A big assumption is does the local utility have net metering? and what type of net metering is available?. Is it the gold standard version where you can carry your surplus forever or is it a low budget version with a yearly reset date where the utility resets the meter to zero and hopefully pays you a pittance for your hard earned surplus. The reset date also factors in. A reset date in the middle of the winter means you cant carry as much surplus generation from the summer as you could with no reset date.
So your type of house, usage and net metering details all can substantially shift the size of the array. A rough range is probably 4 KW on the low end and 10 KW on the high end. Note the difference between KWh and KW. Panels only produce power when the sun is out and rarely do the panels put out the nameplate rating so you now need to go to a computer program to simulate your installation. Search for PVWATTS on the web and plug in your location and array data and it will spit out your monthly and yearly generation. So one opportunity is spend more money up front on an energy efficient home and appliances which reduces the power usage of the home for the long term or spend more on PV panels to cover the extra energy use for less energy efficient home.
So here is the number you probably want , roll the drums, $2 to $3 per watt installed, not including Federal, state and local incentives. If it was tract type development where all the homes got systems, it could be under $2 a watt. So on the low end $8,000 for 4KW system to $30,000 for a 10 KWh custom system. The federal tax credit ratchets down to 22% next year before it goes away, so a 2021 install gets 22% back from the fed. A good place to look up state and local incentives is here
https://www.dsireusa.org/
Personally my smaller home farther north (close to 8000 heating degree days versus 4100 in Detroit) in a colder zone covers all my electric power use, minimal cooling and supplements my heating down to nighttime temps of around 25 degrees. I have 4.6KW of panels installed. I havent paid for power except for a service charge to be connected to the grid for over 5 years and burn 3 to 4 cords a year of wood for the balance of my heating. I sell my solar credits and that just about covers my monthly service feeI have electric appliances so no gas or propane. I do have a solar hot water system but these days its better to buy a heat pump hot water heater and put up a few extra panels on the roof. I actually have 3 arrays of different types and sizes. The price of solar has dropped since I installed my arrays but I designed and installed them myself so I offset some of the higher costs of doing them earlier. As far as I am concerned the money spent is money in the bank. I run econo boxes most of the time and run them longer than a typical car owner so my solar panels probably cost far less than what most folks spend on truck payments.
A good resource is Solar Power your Home for Dummies, there are older versions on line for free if you look around on the web or just buy the newer second edition.
A big consideration with system size is what type of vehicle you plan to drive in 5 to 10 years. Most predictions are it will probably be electric . That means you may want a larger system to cover recharging the vehicle. Most predictions to deal with climate change will be a shift to electric away from fossil fuels to onsite solar power or renewable grid power.