The use of PVs and storage systems behind-the-meter provides backup power supply to owners as well as capable of providing ancillary services to the power grid such as peak load shifting, demand response, energy arbitrage amongst others. This paper proposes a binary-search based optimization algorithm determines the size of photovoltaic (PV) plus battery standalone system in order to meet a defined load profile. The objective function formulation minimizes the overall system cost and makes sure that the total load rejection is zero by the PV-plus-battery (PPB) system for the load profile considered throughout the year. The optimization variable set in the proposed formulation are the number of the PVs and the batteries. The battery state-of-charge, the number of PVs and batteries are set as the optimization constraints. The proposed algorithm is fed with a year-long actual irradiance and load profile data for facility located in Miami FL. The cost factors for the PV and battery are also input to the proposed algorithm. The results show that the proposed algorithm can achieve a zero load deficit for the period and the load profile considered.