Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 390
Default Need help with a project sheet, need date to show/not show based o

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Need help with a project sheet, need date to show/not show based o

Hi,

No need for code

=IF(OR(B2="",D2<""),"",DATE(YEAR(B2),MONTH(B2),DA Y(B2)+31))

Mike

"Max" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Need help with a project sheet, need date to show/not show based o

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


"Max" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 390
Default Need help with a project sheet, need date to show/not show bas

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!

"Mike H" wrote:

Hi,

No need for code

=IF(OR(B2="",D2<""),"",DATE(YEAR(B2),MONTH(B2),DA Y(B2)+31))

Mike

"Max" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Need help with a project sheet, need date to show/not show bas

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

Regards,
Fred.


"Max" wrote in message
...
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!

"Mike H" wrote:

Hi,

No need for code

=IF(OR(B2="",D2<""),"",DATE(YEAR(B2),MONTH(B2),DA Y(B2)+31))

Mike

"Max" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show prior year based on date in other cell Munchkin Excel Worksheet Functions 3 June 17th 09 07:44 PM
How to show date in H2 based on date in I2 minus set number of day jt24 Excel Discussion (Misc queries) 2 January 9th 08 12:37 PM
Show a date based on today DJ Dusty Excel Worksheet Functions 2 November 12th 04 03:20 AM
Show a date based on today DJ Dusty Excel Worksheet Functions 0 November 11th 04 10:32 PM
Show a date based on today DJ Dusty Excel Worksheet Functions 1 November 11th 04 10:28 PM


All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"