Forum Discussion
Anna_C10
Feb 02, 2022Copper Contributor
Nested IF function
Hello everyone, I am trying to create a nested IF function. Screenshot included for reference. The Number of Days column needs to calculate the number of days in the date span in columns C and D. I...
JMB17
Feb 02, 2022Bronze Contributor
I think this will work for you:
=IF(AND(C3>0, D3>0), D3-C3+1, "")
=IF(AND(C3>0, D3>0), D3-C3+1, "")
Anna_C10
Feb 02, 2022Copper Contributor
JMB17 thank you for replying.
The formula you have suggested is bringing up a #VALUE! error
- JMB17Feb 02, 2022Bronze ContributorAre the empty cells not truly empty? If they contain the empty string ( "" ), then you would get #Value. You could try this instead:
=IF(AND(C3<>"", D3<>""), D3-C3+1, "")