2 Replies Latest reply on Aug 20, 2014 9:14 PM by NigelBurton

# If statements in number fields

### Title

If statements in number fields

### Post

I have two number fields in a table essentially calculating similar information. basically they look at a field called Division Code and based on that information should perform a calculation.

My problem is that the first formula works perfectly well and calculates the correct amount depending on which division is selected, but the second one does not, when the user chooses IST in the division code the second formula does not calculate anything.

Can anyone please tell me what is going wrong and suggest a solution.

Thanks

1st formula

If ( Container_Size = 0;0;If(Division_Code = "CSM" or Division_Code =  "FR";((460 * Number_Containers) / Total_MTs);If(Division_Code = "IST";If(Container_Size = 20;((800 * Number_Containers) / Total_MTs);If(Container_Size = 40;((1050 * Number_Containers) / Total_MTs))))))

2nd formula

If ( Container_Size = 0;0;If(Division_Code = "CSM" or Division_Code =  "FR";If ( Container_Size = 20;((600 * Number_Containers) / Total_MTs);If ( Container_Size = 40;((918 * Number_Containers ) / Total_MTs);If(Division_Code = "IST";If(Container_Size=20;((1000 *Number_Containers) / Total_MTs);((1280*Number_Containers)/Total_MTs)))))))

• ###### 1. Re: If statements in number fields

In FileMaker Pro I would never nest the IF statements.  While that is necessary in Excel, FileMaker Pro has the CASE statement to handle these with easier readability.

• ###### 2. Re: If statements in number fields

Thanks for the answer I now have it working properly.