I am trying to reference a detail sheet to a summary sheet:

detail sheet
a b
number occurence
4 7
5 6


summary sheet:

a b c d e
4 6 7 10 1

I want a formula on the summary sheet to look up the occurence of 4, and return a value of 7 for the number 4.

I was trying some sumif formulas with no successs