1 Reply Latest reply on May 8, 2017 1:25 PM by Jay Morehart

# Formula

Either the first part or the second part works depending on which one is placed at the beginning. I need both the parts to work at the same time.

IF (([Grid Type]=2 AND ([Line Type]='T1-SRV' OR [Line Type]='T2')) OR ([Graph Type]='T1-SRV') OR ([Graph Type]='T2')) Then [Enterprise Selection]
ELSEIF ([Grid Type]=1 AND (([Line Type]='T1-SRV' OR [Line Type]='T2') OR ([Line Type]='T1-WKS') OR ([Line Type]='FIN'))) Then [Enterprise Name]

END

• ###### 1. Re: Formula

By "only the first part works" I am assuming you mean that the calculation is only returning the first of the 2 values for all records depending on which is first. If this is not correct or the below answer does not help, please post a packaged workbook/sample data and provide more background on what you are trying to achieve, otherwise we will all just be guessing.

editing the formatting to show what is happening: we can see that there are 3 separate conditions that make the first "if" evaluate to TRUE:

1. [Grid Type]=2 AND ([Line Type]='T1-SRV' OR [Line Type]='T2')
2. ([Graph Type]='T1-SRV')
3. ([Graph Type]='T2')

If any of this are true the expression is true

for the Second "If" there is only 1 condition that allows it to be true:

1. [Grid Type]=1 AND (([Line Type]='T1-SRV' OR [Line Type]='T2') OR ([Line Type]='T1-WKS') OR ([Line Type]='FIN'))

Parentheses colored in Blue are actually not needed here

Parentheses colored in Red make this evaluate as one expression

With out seeing your data I can only speculate that these 2 sets of conditions overlap partially or completely (i.e there are items of Grid Type=2 and Graph Type=T2 that you want to fall in to the second bin, but are going in to the first because they match one of the OR statements)

hope this helps, if not please post a packaged workbook and some more background on what you are attempting.