Link to home
Start Free TrialLog in
Avatar of Andreamary
Andreamary

asked on

Modifying DATEDIF formula if Column A is blank

I am using the following DATEDIF formula to get the number of days in Column D:

=IFERROR(DATEDIF(B2,C2,"D"),"")

But sometimes there are blank cells in Column A and so it's causing errors in my calculations for those rows (1000's of days).

I'd like to be able to modify the above formula to include:

If A2 is blank, then D2 to be blank as well.

Thanks!
Andrea
Avatar of nutsch
nutsch
Flag of United States of America image

Try

=IF(A2="","",ERROR(DATEDIF(B2,C2,"D"),""))

Thomas
Avatar of Andreamary
Andreamary

ASKER

Hi Thomas,

I'm getting an error message that highlights the word "ERROR" in the formula and says "that function not valid"...

Thanks,
Andrea
ASKER CERTIFIED SOLUTION
Avatar of nutsch
nutsch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Change to IFERROR


Thanks
That did the trick...thanks very much!