Hi am trying to check conditions of various cells to decide on the correct calculation. I have come up with the following:
Basically, I am checking the condition of cell B12 on the cover sheet, and the condition if C2 - B8 has a remainder or not and then to make a calc based on the outcome . But it is quite a cumbersome formula with only 2 conditions and if I need to check more conditions - which I will - the whole formula gets much more complicated. Is there a better way, via formula or VBA that can make this style of formula easier?
I also will have many instances in this workbook and others where I need to check such conditions.
Any suggestions to make this more graceful?
Also, I didn't use MOD in my formula because it sometimes gives me strange results when using decimal numbers.
VBA Code:
=IF(AND('Cover Sheet'!B12="yes",($C$2-$B8)/0.2=INT(($C$2-$B8)/0.2)),B8*(C8+0.2),IF(AND('Cover Sheet'!B12="yes",($C$2-$B8)/0.2<>INT(($C$2-$B8)/0.2)),B8*(C8+0.1),IF(AND('Cover Sheet'!B12<>"yes",($C$2-$B8)/0.2<>INT(($C$2-$B8)/0.2)),B8*(C8+0.1),B8*C8)))
Basically, I am checking the condition of cell B12 on the cover sheet, and the condition if C2 - B8 has a remainder or not and then to make a calc based on the outcome . But it is quite a cumbersome formula with only 2 conditions and if I need to check more conditions - which I will - the whole formula gets much more complicated. Is there a better way, via formula or VBA that can make this style of formula easier?
I also will have many instances in this workbook and others where I need to check such conditions.
Any suggestions to make this more graceful?
Also, I didn't use MOD in my formula because it sometimes gives me strange results when using decimal numbers.