Forum Discussion
Old new problem
- Feb 02, 2018
"Posted here yesterday and thought that Willy Lau solved it but not yet." If you want to say it this way, you are pushing people away from helping you.
Anyway, please check the attached file to see if it is what you want.
"Posted here yesterday and thought that Willy Lau solved it but not yet." If you want to say it this way, you are pushing people away from helping you.
Anyway, please check the attached file to see if it is what you want.
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 LauFeb 03, 2018Iron 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.