Hi,

If I try to use the IF condition in SharedFormula the output result is wrong while setting the formula through code. If I use the formula manually in excel gets the correct output.

For example:

cells[“H2”].SetSharedFormula("=IF(AND(NOT(ISBLANK(P2)),P2<50), “< $50M”, IF(AND(P2>=50,P2<=299), “$50M - $299M”, IF(AND(P2>=300,P2<=999), “$300M - $999M”, IF(AND(P2>=1000,P2<=4900), “$1B - $4.9B”,IF(P2>4900, “> $5B”,“Empty”)))))", 12, 1);

Here the P2 cell is Blank, the output is > $5B supposed to be Empty

Where I am going wrong?

If I type the formula manually, its shows Empty