It has been recently demonstrated that yttrium oxyhydride(YHO) films can exhibit reversible photochromic properties when exposed to illumination at ambient conditions. This switchable optical propertyenables their utilization in many technological applications, such as smart windows, sensors, goggles, medical devices, etc. However, how the composition of the films affects their optical properties is not fully clear and therefore demands a straightforward investigation. In this work, the composition of YHO films manufactured by reactive magnetron sputtering under different conditions is deduced in a ternary diagram from Time-of-Flight Elastic Recoil Detection Analysis (ToF-ERDA). The results suggest that stable compounds are formed with a specificchemical formula – YH2-δOδ. In addition, optical and electrical properties of the films are investigated, and a correlation with their compositions is established. The corresponding photochromic response is found in a specific oxygen concentration range (0.45 < δ < 1.5) with maximum and minimum of magnitude on the lower and higher border, respectively.