### Title

Can you have more than one variable in a field calculation?

### Post

Currently, I have a calculation that says:

Field B =

If ( FieldOne = FieldTwo; FieldA-1; FieldA)

So, if B = 4, and FieldOne and FieldTwo have the same number input, then FieldA shows a 3 - which is fine, that's what I'm after.

But, I need another variable stating that

If ( FieldOne > FieldTwo; FieldA-2; FieldA )

So, if B = 4, and Field One has a higher number input than Field Two, then FieldA would show a 2.

I can get the calculation to work with only the first formula but if I ask it to evaluate both "Ifs" I don't get the correct calculation. I thought all I had to was put in both calculations with " or " between them, but that doesn't work.

You might consider nesting the functions inside one another or use the Case function.

What do you want to happen if FieldOne < FieldTwo, FieldA? You might try:

Field B =

Case(FieldOne = FieldTwo; FieldA-1; FieldOne < FieldTwo; FieldA; FieldOne > FieldTwo; FieldA-2; "")

I'm kind of a novice so test this out and read about "Case" from the link I provided.