# 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
###### Who is Participating?

ConsultantCommented:

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

Kevin
0

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

Author Commented:
received error: too many arguments for this function.
0

Author Commented:
thank you.
0

ConsultantCommented:
Wait, before you leave, what are you trying to calculate?

Kevin
0

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

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

Author 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.