Page 1 of 1

### Multiple IF statements

Posted: Thu Nov 21, 2019 2:06 pm
Have spent considerable time just trying to work out how to enter a 'simple' function which is to return a varying value as follows :-

Sorry unable to paste or create a table here.

`•  A  B  C                 1  F  A  Desired Value  2  2  1  3                Where column A is greater than column B                                            3  1  1  1                Where column A is equal to column B4  1  2  0                Where column A is less than column B`

Is there any way to integrate the three functions into one formula - any advice would be most appreciated

### Re: Multiple IF statements

Posted: Thu Nov 21, 2019 2:34 pm
In column C:
Code: Select all   Expand viewCollapse view
`IF( A1>B1; 3; IF(A1=B1; 1; 0 ) )`

In pseudocode that is
`IFvalue of A1 is greater than B1, display 3Else IFvalue of A1 is equal to B1, display 1Else[A1 must be less than B1] display 0`

### Re: Multiple IF statements

Posted: Thu Nov 21, 2019 3:14 pm

### Re: Multiple IF statements

Posted: Thu Nov 21, 2019 6:14 pm
AliGee wrote:• A B C
1 F A Desired Value
2 2 1 3 Where column A is greater than column B
3 1 1 1 Where column A is equal to column B
4 1 2 0 Where column A is less than column B

Is there any way to integrate the three [cases] into one formula?
=CHOOSE(2+SIGN(A2-B2);0;1;3)

[Tutorial] How do I specify the formula for a column?

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know