Assuming $3-5 per watt fully installed and a 6 kWh solar panel array. Plus and additional $10k worth of batteries, you should be able to run most houses 24/7/365 off solar power. So a $40k investment should be around what you need to generate all the power for your home for ~25 years. (Assuming you average 30 kWh used per day) This is pretty close to being a no brainer for certain areas of the country with high electricity prices. (California, Hawaii)