Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
John
 
Posts: n/a
Default Changing a date back one month

Can some one please help me find a way to take a date in a previous row and
get to the same date one month ago. I do not know how to account for the 30
or 31 day discrepancy. Also, if possible could it be the last business day
one month ago. Thank you very much
  #2   Report Post  
Posted to microsoft.public.excel.misc
Peo Sjoblom
 
Posts: n/a
Default Changing a date back one month

Date in A1

=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))



--
Regards,

Peo Sjoblom

Portland, Oregon




"John" wrote in message
...
Can some one please help me find a way to take a date in a previous row
and
get to the same date one month ago. I do not know how to account for the
30
or 31 day discrepancy. Also, if possible could it be the last business
day
one month ago. Thank you very much


  #3   Report Post  
Posted to microsoft.public.excel.misc
pinmaster
 
Posts: n/a
Default Changing a date back one month

Try something like this:

=DATE(YEAR(E7),MONTH(E7)-1,DAY(E7)-LOOKUP(WEEKDAY(E7),{1,2,3,4,5,6,7},{2,0,0,0,0,0,1} ))

if the date falls on the weekend then it should return friday's date.

HTH
JG

"Peo Sjoblom" wrote:

Date in A1

=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))



--
Regards,

Peo Sjoblom

Portland, Oregon




"John" wrote in message
...
Can some one please help me find a way to take a date in a previous row
and
get to the same date one month ago. I do not know how to account for the
30
or 31 day discrepancy. Also, if possible could it be the last business
day
one month ago. Thank you very much



  #4   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default Changing a date back one month

What about holidays?

Biff

"pinmaster" wrote in message
...
Try something like this:

=DATE(YEAR(E7),MONTH(E7)-1,DAY(E7)-LOOKUP(WEEKDAY(E7),{1,2,3,4,5,6,7},{2,0,0,0,0,0,1} ))

if the date falls on the weekend then it should return friday's date.

HTH
JG

"Peo Sjoblom" wrote:

Date in A1

=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))



--
Regards,

Peo Sjoblom

Portland, Oregon




"John" wrote in message
...
Can some one please help me find a way to take a date in a previous row
and
get to the same date one month ago. I do not know how to account for
the
30
or 31 day discrepancy. Also, if possible could it be the last business
day
one month ago. Thank you very much





  #5   Report Post  
Posted to microsoft.public.excel.misc
pinmaster
 
Posts: n/a
Default Changing a date back one month

I have no clue!

Regards
JG

"Biff" wrote:

What about holidays?

Biff

"pinmaster" wrote in message
...
Try something like this:

=DATE(YEAR(E7),MONTH(E7)-1,DAY(E7)-LOOKUP(WEEKDAY(E7),{1,2,3,4,5,6,7},{2,0,0,0,0,0,1} ))

if the date falls on the weekend then it should return friday's date.

HTH
JG

"Peo Sjoblom" wrote:

Date in A1

=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))



--
Regards,

Peo Sjoblom

Portland, Oregon




"John" wrote in message
...
Can some one please help me find a way to take a date in a previous row
and
get to the same date one month ago. I do not know how to account for
the
30
or 31 day discrepancy. Also, if possible could it be the last business
day
one month ago. Thank you very much







  #6   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default Changing a date back one month

This seems to work (needs the ATP for Workday)

=WORKDAY(DATE(YEAR(A2),MONTH(A2)-1,DAY(A2)),IF(WEEKDAY(DATE(YEAR(A2),MONTH(A2)-1,DAY(A2)),2)6,-2,IF(WEEKDAY(DATE(YEAR(A2),MONTH(A2)-1,DAY(A2)),2)=6,-1,0)),J1:J10)

J1:J10 = holidays

Biff

"pinmaster" wrote in message
...
I have no clue!

Regards
JG

"Biff" wrote:

What about holidays?

Biff

"pinmaster" wrote in message
...
Try something like this:

=DATE(YEAR(E7),MONTH(E7)-1,DAY(E7)-LOOKUP(WEEKDAY(E7),{1,2,3,4,5,6,7},{2,0,0,0,0,0,1} ))

if the date falls on the weekend then it should return friday's date.

HTH
JG

"Peo Sjoblom" wrote:

Date in A1

=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))



--
Regards,

Peo Sjoblom

Portland, Oregon




"John" wrote in message
...
Can some one please help me find a way to take a date in a previous
row
and
get to the same date one month ago. I do not know how to account
for
the
30
or 31 day discrepancy. Also, if possible could it be the last
business
day
one month ago. Thank you very much







  #7   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default Changing a date back one month

This seems to work (needs the ATP for Workday)

Disregard!

Upon further testing...........crash and burn!

Biff

"Biff" wrote in message
...
This seems to work (needs the ATP for Workday)

=WORKDAY(DATE(YEAR(A2),MONTH(A2)-1,DAY(A2)),IF(WEEKDAY(DATE(YEAR(A2),MONTH(A2)-1,DAY(A2)),2)6,-2,IF(WEEKDAY(DATE(YEAR(A2),MONTH(A2)-1,DAY(A2)),2)=6,-1,0)),J1:J10)

J1:J10 = holidays

Biff

"pinmaster" wrote in message
...
I have no clue!

Regards
JG

"Biff" wrote:

What about holidays?

Biff

"pinmaster" wrote in message
...
Try something like this:

=DATE(YEAR(E7),MONTH(E7)-1,DAY(E7)-LOOKUP(WEEKDAY(E7),{1,2,3,4,5,6,7},{2,0,0,0,0,0,1} ))

if the date falls on the weekend then it should return friday's date.

HTH
JG

"Peo Sjoblom" wrote:

Date in A1

=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))



--
Regards,

Peo Sjoblom

Portland, Oregon




"John" wrote in message
...
Can some one please help me find a way to take a date in a previous
row
and
get to the same date one month ago. I do not know how to account
for
the
30
or 31 day discrepancy. Also, if possible could it be the last
business
day
one month ago. Thank you very much









  #8   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld
 
Posts: n/a
Default Changing a date back one month

On Mon, 6 Feb 2006 21:01:02 -0800, "John"
wrote:

Can some one please help me find a way to take a date in a previous row and
get to the same date one month ago. I do not know how to account for the 30
or 31 day discrepancy. Also, if possible could it be the last business day
one month ago. Thank you very much


Target date in A1:

One Month Back:

=edate(A1,-1)

One Month Back, adjusted to either the closest or subsequent business day:

Preceding business day:

=workday(edate(A1,-1)+1,-1)

Subsequent business day:

=workday(edate(A1,-1)-1,1)

Last business day of the preceding month:

=workday(A1-DAY(A1)+1,-1)

-------------------------
If the WORKDAY and EDATE functions are not available, and returns the #NAME?
error, install and load the Analysis ToolPak add-in.

How?

On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click
OK.
If necessary, follow the instructions in the setup program.
--------------------------

The WORKDAY function has an optional HOLIDAYS argument to exclude Holidays.
See HELP for details as to how to use it. Briefly, you enter a list of dates
in a range, and add that reference to the formula.


--ron
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
Changing date format in a footer Gord Dibben Excel Discussion (Misc queries) 2 December 9th 05 06:36 PM
How do I stop excel automatically changing my date to 2005? zoemcb Excel Discussion (Misc queries) 6 April 30th 05 02:39 AM
Changing Cell formats to date fields automatically PCLIVE Excel Worksheet Functions 3 April 12th 05 10:34 PM
Lookup the month in a date string 01/03/05 Una Excel Worksheet Functions 1 March 30th 05 09:45 AM
Month Year Date Format Jamie Excel Worksheet Functions 2 February 7th 05 06:43 PM


All times are GMT +1. The time now is 11:27 AM.

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"