# How to create formula based on column value

I have a column in my SharePoint list named "Container Content." When adding a record in SharePoint you can choose one of three items in this column, it is a choice column. The three items you are able to choose are "Cases, Pallets, SlipSheet."I also have a column named "Content Amount." This column will tell us the amount of what the container content is. For example, if the container content is "cases" and the container amount is 980, then I have 980 cases. I have created a new calculated column that will need to take the value of the "container content" column and divide by 36 if it's Cases, divide by 32 of its pallets and divide by 10 if it's slip sheets. I have tried to create the formula but it is not working. I am a noob when it comes to formulas. I am hoping someone can help and/or stear me in the right direction.

Here is my code sample. `=IF([Container Content]="Cases"/36)+IF([Container Content]="Pallets"/32)+IF([Container Content]="Slip Sheets"/10)`

• I guess "Content Amount" column is number. So, You should be dividing Content amount column not container content. Why are you adding the values after dividing in formula.?please add more details in your question. – Ganesh Sanap Oct 17 '18 at 3:16
• Hi Ganesh, Yes, you're right. I've redone the code but it is still not working. I think this code snippet might provide more information as to the outcome I'm trying to accomplish. =IF([Container Content]="Cases" THEN [CONTENT AMOUNT] /96) IF([Container Content]="Pallets" THEN [CONTENT AMOUNT] /32) IF([Container Content]="Slip Sheets" THEN [CONTENT AMOUNT] /10) – Bertocious Oct 17 '18 at 19:07

First of all, make sure that the "Content Amount" field is of type "Number". Then use following formula for your calculated field:

``````=IF([Container Content]="Cases",[Content Amount]/96 , IF([Container Content]="Pallets",[Content Amount]/32,[Content Amount]/10))
``````

And return the calculated value as "Number".