To view the topic from a horizontal rather than a vertical perspective, V2 must be reached by the end of the Takeoff Distance. The legislation (FAR 25 and all of it's equivalents) requires that.
The same legislation also requires that, at the end of the Takeoff Distance, a screen height of 15 ft (Wet Runway), 35 ft (Dry Runway), or 50 ft (turning manoeuvre) be achieved.
Putting those two statements together, V2 must have been achieved at or by the time that the applicable screen height has been reached.
The reason that I included the "or by the time" phrase into the last sentence is that for turning procedures where 50 ft screen height is required, the manufacturers don't provide separate data for the 50 ft case, and some of the 1st Segment must be considered for the 35 ft to 50 ft climb whilst still within the TODA, and the 1st Segment is conducted at V2, in short, it's already been achieved (in this case).
Regards,
Old Smokey