• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

IF Function returning wrong results

comp764

Member
Hello,

I'm using a gantt chart based on conditional formatting I downloaded from Chandoo.

I changed some formulas. I have a IF function linked to another IF function.

I have this formula in E7 =IF(E6=0,"",E6) and in

E8 right below, I have this formula =IF(AND(E$7>=$C8,E$7<=$D8),"1","")

What's happening is when E7 is empty or blank the second formula in E8 should be blank but it returning a 1.

Is there a way to stop the formula in cell E8 to stop reading or seeing the formula in E7 to return the correct results?
 
Hi Dhamo,

Thank you for your response, but the formula you gave me had the same results. I did some more research and I ended up adding a "-0" into the IF function. Which goes like this

=IF(E6="","-0",E6.


Not sure how this works, but I think it's telling the AND function that

=IF(AND(E$7>=$C8,E$7<=$D8),"1","") which C8 & D8 are blank, and now that E6 is showing -0 it's true. I then added conditional formatting to the cells if it's equal to "-0" and added white font color so it can't be seen.


Not sure why the formula in E6 was looking at the formula in E7 even though the formula was showing a blank cell.


Thanks again!
 
Back
Top