# Lookup between a group of text values and assigning numbers to it

#### vipin30sep

##### New Member
Hello,

So I have a group of text values for Sizes like twins, Small, Medium, Large etc. in a sheet and I'm assigning values to those sizes. I'm using the formula as below and it always gives me error. Please help. Here is the formula I'm trying to use,
Code:
``=LOOKUP('Prepaid Customer'!Y2,{"Twins", Small,Medium,Large,X-Large,2XL,3XL,Singleton},{8,7,6,5,4,3,2,1})``

Here, 'Prepaid Customer'!Y2' cell contains formula to calculate Sizes

### Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

#### DanteAmor

##### Well-known Member
Data must be alphabetically ordered from A-Z

Try this:

 =LOOKUP('Prepaid Customer'!Y2,{"2XL","3XL","Large","Medium","Singleton","Small","Twins","X-Large"},{3,2,5,6,1,7,8,4})

<tbody>
</tbody>

<tbody>
</tbody>

#### vipin30sep

##### New Member
Thanks for your help. It doesn't seem to work. So these are the values that I need to assign,

Twins - 1
Small - 2
Medium - 3
Large - 4
X-Large - 5
2XL - 6
3XL - 7
Singleton - 8

Data must be alphabetically ordered from A-Z

Try this:

 =LOOKUP('Prepaid Customer'!Y2,{"2XL","3XL","Large","Medium","Singleton","Small","Twins","X-Large"},{3,2,5,6,1,7,8,4})

<tbody>
</tbody>

<tbody>
</tbody>

#### vipin30sep

##### New Member
Actually it did work. I missed one value. Thanks for your help. It works flawlessly!! Thanks again!!

Replies
5
Views
84
Replies
13
Views
894
Replies
1
Views
232
Replies
2
Views
428
Replies
0
Views
199