Solved

Modifying DATEDIF formula if Column A is blank

Posted on 2014-03-25
5
2,912 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Naresh Patel
ID: 39953881
Change to IFERROR


Thanks
0
 

Author Closing Comment

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

Featured Post

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Companies keep a much closer eye on costs today, so changing to new Technology – Microsoft Office 365 is the smartest move to take.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

707 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