© 2018 by the authors. Licensee MDPI, Basel, Switzerland. The current work investigates how adding a battery of optimal capacity to a grid-connected photovoltaic (PV) system can improve its economic feasibility. Also, the effect of different parameters on the feasibility of the PV system was evaluated. The optimal battery capacity (OBC) was determined for different saving targets of the annual electricity consumption of the chosen building. For this aim, real electricity consumption data of a residential building in Landskrona, Sweden, was used as energy consumption profile. A Solar World SW325XL, which is a monocrystalline solar panel, was selected as PV panel. The calculations were performed under the metrological and economic conditions of southern Sweden. Different working parameters (WPs) were considered (prices of the battery, feed-in tariffs, and saving targets). The performed calculations show that the optimal battery capacity (OBC), in which the payback time (PBT) of the system is maximized, strongly depends on the WP. The proper selection of the battery can considerably increase the economic feasibility of the PV system in southern Sweden. However, in some cases, using battery can have a negative impact on the PBT of the system. The results show that the electricity price, the module price, the inverter price, and the inverter lifetime have the highest effect on the PBT.