# If/or or Vlookup

#### MermaidNiki

##### New Member
Hi,
I need another complex if/or statement. I created one that would in theory work, but it has too many arguments. I have a cell that contains IDs for 33 monkeys. Each monkey will be listed as high ranking (h), middle ranking (m), or low ranking (l) in another column. Here is my code with too many arguments:
=IF(OR(J2=“rn”, J2=“tl”, J2=“wj”, J2=“an”, J2=“rj”, J2=“fd”, J2=“zd”, J2=“od”, J2=“id”, J2=“td”, J2=“qd”, J2=“ul”, J2=“uk”, J2=“ql”, J2=“fm”, J2=“ba”, J2=“bp”, J2=“cp”, J2=“aa”, J2=“rp”, J2=“up”, J2=“ak”, J2=“ll”, J2=“mm”, J2=“kn”, J2=“om”, J2=“ej”, J2=“nu”, J2=“qs”, J2=“hs”, J2=“cu”, J2=“fu”, J2=“gs”),”h”,”h”,”m”,”l”,”l”,”h”,”h”,”m”,”m”,”l”,”l”,”h”,”h”,”m”,”l”,” h”,”h”,”m”,”m”,”l”,”l”,”h”,”h”,”m”,”m”,”l”,”l”,”h”,”h”,”m”,”m”,”l”,”l”)

Is there a way to combine these somehow or perhaps a more efficient code? The other identifier I can use is that these monkeys are in 3 different groups and there is a separate column that defines this (R2, R1, and PB). I can list which monkeys are in which group if it helps.

### Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

#### FDibbins

##### Well-known Member
I would make a small table with codes and rank, then use VLOOKUP. Something like...
 E​ F​ G​ H​ I​ J​ 1​ rn h 2​ tl h h rn 3​ wj m 4​ an l 5​ rj l
I2=VLOOKUP(J2,\$E\$1:\$F\$5,2,0)

I obviously did not use all of your codes, so add what you need and adjust the range accordingly

#### MermaidNiki

##### New Member
Perfect! Thank you - this did exactly what I needed it to and will help immensely in the future.

I would make a small table with codes and rank, then use VLOOKUP. Something like...
 E​ F​ G​ H​ I​ J​ 1​ rn h 2​ tl h h rn 3​ wj m 4​ an l 5​ rj l

<tbody>
</tbody>

I2=VLOOKUP(J2,\$E\$1:\$F\$5,2,0)

I obviously did not use all of your codes, so add what you need and adjust the range accordingly

#### FDibbins

##### Well-known Member
Good stuff, happy to help

Last edited:

Replies
3
Views
819
Replies
2
Views
276
Replies
0
Views
291
Replies
1
Views
308
Replies
1
Views
267

1,195,635
Messages
6,010,831
Members
441,569
Latest member
PeggyLee

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