i have an excel that is reading from our database ... i need to know how can i make a script that calculate the number of boxes

like.... if it`s onion whe have 20 in one box
if it`s potatos whe have 12 in one box.....
if it`s telephones whe have 2 in one box

can sombady tell me how can i make a script that could calculate the number of boxes for each of elements?