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
AndreamaryAsked:
Who is Participating?
 
nutschConnect With a Mentor Commented:
My bad, should be iferror

=IF(A2="","",IFERROR(DATEDIF(B2,C2,"D"),""))
1
 
nutschCommented:
Try

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

Thomas
0
 
AndreamaryAuthor Commented:
Hi Thomas,

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

Thanks,
Andrea
0
 
Naresh PatelTraderCommented:
Change to IFERROR


Thanks
0
 
AndreamaryAuthor Commented:
That did the trick...thanks very much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.