0
votes

I have two columns in ExCEL: Start Date and End Date. I want to calculate the days in my program based on this. If the End date is blank I want to calculate Start date to today. If the End date contains a date I want to calculate from start date to end date. As an odd side note I have a few where both start and end date cells are blank. I want that to return a blank cell. "B" is my start Date column, "C" is my End Date Column What I have tried so far:

=
IF(ISBLANK(B2), " ",
IF(ISBLANK(C2), DATEDIF(B2,TODAY(),"D",
DATEDIF(B2,C2,"D")))
1

1 Answers

2
votes

you do not need DateDif for just number of days. Just subtract the two numbers and format the output as general.

=IF(B2<>"",IF(C2<>"",C2-B2,today()-B2),"")