We analyze the valence electronic structure of cobalt phthalocyanine (CoPc) by means of optimally tuning a range-separated hybrid functional. The tuning is performed by modifying both the amount of short-range exact exchange (α) included in the hybrid functional and the range-separation parameter (γ), with two strategies employed for finding the optimal γ for each α. The influence of these two parameters on the structural, electronic, and magnetic properties of CoPc is thoroughly investigated. The electronic structure is found to be very sensitive to the amount and range in which the exact exchange is included. The electronic structure obtained using the optimal parameters is compared to literature gas-phase photo-electron data and GW calculations, with the unoccupied states additionally compared with inverse photo-electron spectroscopy measurements. The calculated spectrum with tuned γ, determined for the optimal value of α = 0.1, yields a very good agreement with both experimental results and with GW calculations that well-reproduce the experimental data.