Say your inputs are in C1 and D1, (apples and green, respectively) and your entire range is A2:B1000

then:

=INDEX(INDEX($B$2:$B$1000,MATCH(C1,$A$2:$A$1000,0)):$B$1000,MATCH(D1,INDEX($A$2:$A$1000,MATCH(C1,$A$2:$A$1000,0)):$A$1000,0))