Need help with a project sheet, need date to show/not show based o

M

Max

Hello,

I have the following formula in cell S2
=IF(B2="","",DATE(YEAR(B2),MONTH(B2),DAY(B2)+31))
This takes a date in cell B2 and adds 31 days to it and displays it.

What I need to do is to NOT have cell S2 show any date if anything is in
cell D2.

I'm not very adept at Vis Basic if that what it will take to do it.

Thanks
Max
 
M

Mike H

Hi,

No need for code

=IF(OR(B2="",D2<>""),"",DATE(YEAR(B2),MONTH(B2),DAY(B2)+31))

Mike
 
×

מיכ×ל (מיקי) ×בידן

In order to add ONE full month to a date [if this is your intension] I would
suggest using: =EDATE(B2,1)
Check your formula against the above
PS: You may need to install the Analysis Toolpak if you are using Excel ver.
prior to 2007.
Micky
 
M

Max

Mike,

Initially it worked the opposite of what I wanted it to do, but after
changing the <> to a = it seems to work fine.

Thanks for your help!
 
F

Fred Smith

You can also shorten your formula to:
=IF(OR(B2="",D2=""),"",B2+31)

Regards,
Fred.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top