I'm trying to create a function that uses two variables to search a table and return a result.

I have a table with Current (in Amps) down the left side in the first column - from 1 to 25 Amps. The first row is Wire Gauges - 14, 12, 10, 8, 6, 4, 3, 2. The data in the table is the distance (in feet) which you can run that gauge wire with that current, with less than %2 losses.

I'm trying to create a function that supplies "Current" and "Distance" and comes out with the proper gauge to use. I thought maybe nested lookup functions would work, but even if they did it doesn't look like an elegant solution.

Anyone have any ideas?

Thanks!
/Ethan