Vast majority of solar power costs are upfront capital costs. So if you know how much the panels/installation costs, what are your financing costs for ~30 year amortizing loan and how much the sun is expected to shine in the installation place, calculating the cost of electricity price per kWh is not too advanced Excel trickery.