Excel If or statment

Trying to combined two if statements together.

=IF(B2<DATEVALUE("1/1/2011"),C2-DATEVALUE("1/1/2011"),C2-B2)

=IF(ISBLANK(C2)=TRUE,B2-DATEVALUE("1/1/2011"),C2-B2)

Tried this statement but not working correctly.

=IF(OR(ISBLANK(C2)=TRUE,B2<DATEVALUE("1/1/2011"),DATEVALUE("1/1/2011")-C2,C2-DATEVALUE("1/1/2011")),C2-B2)
Date-Test.xlsx
jbakerstullAsked:
Who is Participating?
 
zorvek (Kevin Jones)Connect With a Mentor ConsultantCommented:
I goofed. How about:

=IF(ISBLANK(C2),B2-DATEVALUE("1/1/2011"),IF(B2<DATEVALUE("1/1/2011"),C2-DATEVALUE("1/1/2011"),C2-B2))

Kevin
0
 
zorvek (Kevin Jones)ConsultantCommented:
=IF(OR(ISBLANK(C2)=TRUE,B2<DATEVALUE("1/1/2011")),DATEVALUE("1/1/2011")-C2,C2-DATEVALUE("1/1/2011"),C2-B2)

Kevin
0
 
jbakerstullAuthor Commented:
received error: too many arguments for this function.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
jbakerstullAuthor Commented:
thank you.
0
 
zorvek (Kevin Jones)ConsultantCommented:
Wait, before you leave, what are you trying to calculate?

Kevin
0
 
zorvek (Kevin Jones)ConsultantCommented:
If B and C are entered you want the difference in days between the two dates.

What do you want if C is not entered? The difference in dates from 1/1/2011 whether B is before or after that date?

Kevin
0
 
zorvek (Kevin Jones)ConsultantCommented:
This formula produces the same result and might be easier to understand:

   =IF(C2="",B2-DATEVALUE("1/1/2011"),C2-MAX(B2,DATEVALUE("1/1/2011")))

Kevin
0
 
jbakerstullAuthor Commented:
Sorry.. If C is missing.. then I applied a date value.. that's why I was using isblank = true then assigned a datevalue
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.