# Returning a value in a table

#### Cdshep15

##### New Member
I would like to have a cell that would return a certain value based on what is entered in another cell.

Example...

If cell A1 = "yes" and cell B1 = "sir" then D1 would display "great"

but if cell A1 = "no" and cell B1 = "ma'am" then D1 would display "poor"

I have a table of all possible combinations in another part of the worksheet. Each combination of yes, no in A1 and great, poor in B1 would yield a different outcome that is listed in the table. I'm trying to use something like this....

=IF((AND(A1=F3:F61,B1=G3:G61)),H3:H61,"look it up")

the "look it up" part just means that the combo is not valid. Help would be much appreciated.

Thanks!!

### Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Cdshep15

A solution is to look for the concatenation of the 2 values.

Code:
``=IF(ISNUMBER(MATCH(A1&B1,F3:F61&G3:G61,0)),INDEX(H3:H61,MATCH(A1&B1,F3:F61&G3:G61,0)),"Look it up")``
This is an array formula and so MUST be entered with CTRL+SHIFT+ENTER and not just ENTER.

Hope this helps
PGC

Replies
3
Views
155
Replies
5
Views
742
Replies
1
Views
665
Replies
13
Views
456
Replies
1
Views
151

1,219,819
Messages
6,150,401
Members
450,959
Latest member
Rbro

### 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