A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Add 2 days before and after birthdate



 
 
Thread Tools Display Modes
  #1  
Old April 8th, 2009, 09:24 PM posted to microsoft.public.excel.worksheet.functions
Sunflower
external usenet poster
 
Posts: 44
Default Add 2 days before and after birthdate

I have column of birthdates and need to have a date range showing 2
days before and after the Month and day (in current year) of
birthdate.

For example

Birthdate:
01/31/1968

Result:
01/29/2009 - 02/02/2009

Is this possible?

Any and all help greatly appreciated
  #2  
Old April 8th, 2009, 09:50 PM posted to microsoft.public.excel.worksheet.functions
Dave Peterson
external usenet poster
 
Posts: 19,791
Default Add 2 days before and after birthdate

In a single cell?

=text(a1-2,"mm/dd/yyyy") & " - " & text(a1+2,"mm/dd/yyyy")

Where A1 contains the date.



Sunflower wrote:

I have column of birthdates and need to have a date range showing 2
days before and after the Month and day (in current year) of
birthdate.

For example

Birthdate:
01/31/1968

Result:
01/29/2009 - 02/02/2009

Is this possible?

Any and all help greatly appreciated


--

Dave Peterson
  #3  
Old April 8th, 2009, 11:36 PM posted to microsoft.public.excel.worksheet.functions
Sunflower
external usenet poster
 
Posts: 44
Default Add 2 days before and after birthdate

On Apr 8, 1:50*pm, Dave Peterson wrote:
In a single cell?

=text(a1-2,"mm/dd/yyyy") & " - " & text(a1+2,"mm/dd/yyyy")

Where A1 contains the date.





Sunflower wrote:

I have column of birthdates and need to have a date range showing 2
days before and after the Month and day (in current year) of
birthdate.


For example


Birthdate:
01/31/1968


Result:
01/29/2009 - 02/02/2009


Is this possible?


Any and all help greatly appreciated


--

Dave Peterson- Hide quoted text -

- Show quoted text -


I do want the result in a single cell and what you sent works...
However, when I put your formula in the B1 cell
I am getting it to show...
01/29/1968 - 02/02/1968

What I need is the year to be current ...
01/29/2009 - 02/02/2009

Any and all help greatly appreciated
  #4  
Old April 8th, 2009, 11:50 PM posted to microsoft.public.excel.worksheet.functions
Dave Peterson
external usenet poster
 
Posts: 19,791
Default Add 2 days before and after birthdate

Sorry, I missed that:

=text(date(year(today()),month(a1),day(a1)-2),"mm/dd/yyyy") & " - " &
text(date(year(today()),month(a1),day(a1)+2),"mm/dd/yyyy")


Sunflower wrote:

On Apr 8, 1:50 pm, Dave Peterson wrote:
In a single cell?

=text(a1-2,"mm/dd/yyyy") & " - " & text(a1+2,"mm/dd/yyyy")

Where A1 contains the date.





Sunflower wrote:

I have column of birthdates and need to have a date range showing 2
days before and after the Month and day (in current year) of
birthdate.


For example


Birthdate:
01/31/1968


Result:
01/29/2009 - 02/02/2009


Is this possible?


Any and all help greatly appreciated


--

Dave Peterson- Hide quoted text -

- Show quoted text -


I do want the result in a single cell and what you sent works...
However, when I put your formula in the B1 cell
I am getting it to show...
01/29/1968 - 02/02/1968

What I need is the year to be current ...
01/29/2009 - 02/02/2009

Any and all help greatly appreciated


--

Dave Peterson
  #5  
Old April 8th, 2009, 11:57 PM posted to microsoft.public.excel.worksheet.functions
Sunflower
external usenet poster
 
Posts: 44
Default Add 2 days before and after birthdate

On Apr 8, 3:50*pm, Dave Peterson wrote:
Sorry, I missed that:

=text(date(year(today()),month(a1),day(a1)-2),"mm/dd/yyyy") & " - " &
*text(date(year(today()),month(a1),day(a1)+2),"mm/dd/yyyy")





Sunflower wrote:

On Apr 8, 1:50 pm, Dave Peterson wrote:
In a single cell?


=text(a1-2,"mm/dd/yyyy") & " - " & text(a1+2,"mm/dd/yyyy")


Where A1 contains the date.


Sunflower wrote:


I have column of birthdates and need to have a date range showing 2
days before and after the Month and day (in current year) of
birthdate.


For example


Birthdate:
01/31/1968


Result:
01/29/2009 - 02/02/2009


Is this possible?


Any and all help greatly appreciated


--


Dave Peterson- Hide quoted text -


- Show quoted text -


I do want the result in a single cell and what you sent works...
However, when I put your formula in the B1 cell
I am getting it to show...
01/29/1968 - 02/02/1968


What I need is the year to be current ...
01/29/2009 - 02/02/2009


Any and all help greatly appreciated


--

Dave Peterson- Hide quoted text -

- Show quoted text -


BEAUTIFUL!!! Works like a charm!! Thank you so much
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:10 PM.


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