I've tried SUMIF, SUMIFS, SUMPRODUCT (with SUMIF) but the problem here seems to be CONTAINS. You can do this for text using wildcard ** but not numbers. How would I do this?

Example:

Sum column D if Column B (which are two sets of numbers) contains cell H5 (which is a number)

THANK YOU IN ADVANCE!