Can I please get some help on ideas with a formula on the following:

I have the scenario:

Code: Acceptable Ranges

100200 100180 - 100290

-----------------------------------------------------------------------------------

G Code Number 1 Number 2

100185 100 200

100285 100 200

100385 100 200

Looking at these two tables, can you suggest a useful formula or combination of formulas to do the following in one cell:

- Look in the second table and take the sumsquare (sum(Num1*Num2)) of those codes that are included in the acceptable range for the table above?

Intuitively, we can see that the answer would be 400, since only the first two codes in the second table would be picked up by the criteria, BUT HOW do you do this in Excel? SUMIF? ARRAYS? HELP .