Solved

Modifying DATEDIF formula if Column A is blank

Posted on 2014-03-25
5
1,966 Views
Last Modified: 2014-03-25
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
0
Comment
Question by:Andreamary
  • 2
  • 2
5 Comments
 
LVL 39

Expert Comment

by:nutsch
ID: 39953857
Try

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

Thomas
0
 

Author Comment

by:Andreamary
ID: 39953875
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
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 39953878
My bad, should be iferror

=IF(A2="","",IFERROR(DATEDIF(B2,C2,"D"),""))
0
 
LVL 8

Expert Comment

by:itjockey
ID: 39953881
Change to IFERROR


Thanks
0
 

Author Closing Comment

by:Andreamary
ID: 39953894
That did the trick...thanks very much!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Meetings to discuss business process can waste time, and often do .  The meeting's dialog can get confusing when participants have different professional perspectives and backgrounds.  A jointly-developed process picture helps wade through the confu…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now