Jump to content

Excel - "IF" and dates


lord_seagrave
 Share

Recommended Posts

Ok - ISBLANK doesn't work as a logical test inside the IF function, and your DATE syntax needs to be altered

 

Try:

 

=IF(N2="", DATE(YEAR(E2)+5,MONTH(E2),DAY(E2)), DATE(YEAR(N2)+5,MONTH(N2),DAY(N2)))

 

No line feeds or anything - looks a bit strange on my phone screen, but copied straight from the test cells.

Hope this helps :)

Edited by CaptainBeaky
Link to comment
Share on other sites

Ok - ISBLANK doesn't work as a logical test inside the IF function, and your DATE syntax needs to be altered

 

Try:

 

=IF(N2="", DATE(YEAR(E2)+5,MONTH(E2),DAY(E2)), DATE(YEAR(N2)+5,MONTH(N2),DAY(N2)))

 

No line feeds or anything - looks a bit strange on my phone screen, but copied straight from the test cells.

Hope this helps :)

Perfect, Beaky, thank-you very much indeed!

 

:good:

 

LS

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...