Forum Discussion
Akila1993
Jun 25, 2020Copper Contributor
IF-function for date in excel, some dates becomes 0
Hi! I am doing a payable in excel for an assignment. I'm using the IF-function to calculate what the date should be in the column named date of payment. This is the function I have created: =OM(B6...
BaloDeChamp
Jun 25, 2020Copper Contributor
Hi Akila,
Some dates are returning 0 because the first part of your formula IF(B13=420,C13+$O$6,IF(B13=500,C13+$O$7)) is restricted to only two values. According to your workbook, you have four values in Column B (500,420,150 and 320) but your formula is only referencing 420 and 500. So when it gets to a row that has either 150 or 320, the first part of the formula will return 0 which is why some of the dates becomes 0.
The same thing also for the second part of your formula (IF(B6=150,(C6+$O$8)*(IF(B6=320,(C6+$O$9),0))))); it is only referencing two values.
I will advise that you adjust your formula to cover the four values in Column B or use a a combination of IF and OR Function.
I hope this helps.