# Lookup & If Statement and Table Array

#### t01te6

##### Board Regular
Hi,

I have so tried to answer this, 5hours now and 5 forums and my brain still can't get my head around it.

I would like to return a number based on two conditions, i.e:

 Area Soil Class Area Soil Moray Sandy Sandy Mineral Moray 1 2 Perth 4 2

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>

Assuming above is two tables the first would have the area and soil type in, I want to put a formula in the class cell next to this that would look up the other table find Moray, check to see if the soil is sandy or mineral in the first table and return the site class number associated to it. In this example returning 1, but if I changed area to Perth it would return 4.

Thanks

### Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

#### WarfritLive

##### Board Regular
Excel 2013 32 bit
ABCDEFGH
1AreaSoilClassAreaSoilColumn1
2MoraySandy1SandyMineral
3PerthMineral2Moray12
4MoraySandy1Perth42
5
6
7
8
9
10

</tbody>

Formula in Class column is:
=IF([@Area]<>"",VLOOKUP([@Area],Table2,IF([@Soil]="Sandy",2,IF([@Soil]="Mineral",3)),FALSE),"")

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,008
Messages
5,834,858
Members
430,324
Latest member
bosphoruskid

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back