As I mentioned in comments, you can use:
=INDEX($J$2:$J$40,MATCH(TRIM(M2) & TRIM(N2) & TRIM(O2),TRIM($G$2:$G$40) & TRIM($H$2:$H$40) & TRIM($I$2:$I$40),0))
This is an array formula, so type the formula then press CTRL+SHIFT+ENTER. Curly brackets will automatically appear at the start and end of the formula.
Or more elegant approach (similar to this post):
=LOOKUP(2,1/(TRIM($G$2:$G$40)=TRIM(M2))/(TRIM($H$2:$H$40)=TRIM(N2))/(TRIM($I$2:$I$40)=TRIM(O2)),$J$2:$J$40)
above formula is normal (not array) formula