Question: All.

I am trying to use IF/OR/AND formula for the below conditions.

1. If S = 0, then use the lowest of M and F, provided both M and F has a value which is greater than 0. If either one in M and F is zero then take the one in M and F which is greater than zero.
2. If all S,M and F is Zero, then it should show zero.
3. If M and F has a value which is greater than S, even then it should use the value which is in S, provided S is greater than 0.
4. In the Final Value column - It should show me the the value of S, provided the value of S is greater than Zero or the value from condition 1.

Please note: I do not require all the condition to be satisfied in one single formula. There can be multiple columns to fulfill these conditions.

I am attaching a spreadsheet where i have these conditions. Also, i have tried using formula. Please feel free to create and new tab and work on it.

Link for the excel file: <https://drive.google.com/open?id=0B403VWJ4ZXfoRDNGdUNCSVNkMWc>

Thank you very much!

Answer: 
The formula of

```
=IF(S1>0,S1,IF(AND(M1>0,F1>0),MIN(M1,F1),MAX(0,M1,F1)))

```

will:

* take S if it is greater than 0
* else
	+ if both M and F are greater than 0, the smaller of the two
	+ else (i.e. if one, or both, is not greater than 0) the maximum of the two

---

Judging by the other answers, I assume that (despite not being stated in the question) the mapping from letters used in your question to columns in your spreadsheet is actually

```
S --> A
M --> B
F --> C

```

so using that mapping and applying it to the formula gives

```
=IF(A1>0,A1,IF(AND(B1>0,C1>0),MIN(B1,C1),MAX(0,B1,C1)))

```

or, if your data starts in row 2 (also not mentioned in your question):

```
=IF(A2>0,A2,IF(AND(B2>0,C2>0),MIN(B2,C2),MAX(0,B2,C2)))

```
Assuming Value of `S` will never be less than `0`, enter the following formula in `Cell D2`

```
=IF(A2=0,IF(B2>0,IF(C2>0,MIN(B2,C2),B2),IF(C2>0,C2,0)),IF(AND(B2>A2,C2>A2),A2,MIN(B2,C2)))

```

Drag/Copy down as required.

[![enter image description here](https://i.stack.imgur.com/BR4xP.png)](https://i.stack.imgur.com/BR4xP.png)