Forum Discussion

jjdrake's avatar
jjdrake
Copper Contributor
Feb 02, 2018
Solved

Old new problem

Posted here yesterday and thought that Willy Lau solved it but not yet. Have a new condition in there which makes mess more messier so, help, please. I can't manage to put it all together, something is always missing. 

3 Replies

    • jjdrake's avatar
      jjdrake
      Copper Contributor

      Sorry Willy Lau, no hard feelings, please. Didn't mean to make any kind of pressure at all. This works like a charm. Thank you again! Cheers!

      • Willy Lau's avatar
        Willy Lau
        Iron Contributor

        You should read the file and learn the formula.

         

        IF function can help you to do it.  In case of multiple conditions, you may need to use Nested-IF functions.  However, nested-if is hard to read.  If your result is a calculation, you can simply use the ( ) to wrap your condition and multiply by the value you want, e.g.

        =(G8 > I10) * (G8 - I10) * H10

         in Excel, a TRUE value multiply by another value is equal to ( 1 × the value).  In the above formula, if G8's value > I10's value, it is a true case, and it multiplies by (G8-I10) * H10, the final result will be exactly (G8-I10) * H10.  It is because 1 × (G8-I10) × H10 = (G8-I10) × H10.  If G8 is not greater than I10, it is a false case.  In Excel, a false case is equal to 0, and so the result will be zero as 0 × (G8-I10) × H10 = 0.

         

        You can see the difference between Nested-If function and case calculation here.

         

         

         

Resources