Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Subtracting Dates

I'm sure there must be a simple way of doing this ...

I have a worksheet where the column headers (ie; cells A1:L1) are dates -
the first of each month going back for 12 months. So, A1 is 1 Nov 2007, B1
is 1 Oct 2007, etc.

What I need is for cells B1:L1 to update automatically when I change the
value of A1 to the first of the current month. So, when A1 becomes 1 Dec
2007, I need B1 to become 1 Nov 2007, etc.

The only way I can think of doing this is by using EOMONTH. Hence, B1 =
EOMONTH(A1,-2)+1. This works OK but to use this function I had to load one
of the add-ins (Analysis Toolpak?) and I notice that when the spreadsheet is
e-mailed to users who have not loaded this, the NAME error is shown until it
is loaded. As the recipients are a large group with mixed IT abilities, I
can forsee problems asking them to do this!

There must be another way?!

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Subtracting Dates

In B1: =EDATE(A1,-1)

copy B1 across to L1


"Terry Bennett" wrote:

I'm sure there must be a simple way of doing this ...

I have a worksheet where the column headers (ie; cells A1:L1) are dates -
the first of each month going back for 12 months. So, A1 is 1 Nov 2007, B1
is 1 Oct 2007, etc.

What I need is for cells B1:L1 to update automatically when I change the
value of A1 to the first of the current month. So, when A1 becomes 1 Dec
2007, I need B1 to become 1 Nov 2007, etc.

The only way I can think of doing this is by using EOMONTH. Hence, B1 =
EOMONTH(A1,-2)+1. This works OK but to use this function I had to load one
of the add-ins (Analysis Toolpak?) and I notice that when the spreadsheet is
e-mailed to users who have not loaded this, the NAME error is shown until it
is loaded. As the recipients are a large group with mixed IT abilities, I
can forsee problems asking them to do this!

There must be another way?!

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 695
Default Subtracting Dates

in B1 type
=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))


"Terry Bennett" skrev:

I'm sure there must be a simple way of doing this ...

I have a worksheet where the column headers (ie; cells A1:L1) are dates -
the first of each month going back for 12 months. So, A1 is 1 Nov 2007, B1
is 1 Oct 2007, etc.

What I need is for cells B1:L1 to update automatically when I change the
value of A1 to the first of the current month. So, when A1 becomes 1 Dec
2007, I need B1 to become 1 Nov 2007, etc.

The only way I can think of doing this is by using EOMONTH. Hence, B1 =
EOMONTH(A1,-2)+1. This works OK but to use this function I had to load one
of the add-ins (Analysis Toolpak?) and I notice that when the spreadsheet is
e-mailed to users who have not loaded this, the NAME error is shown until it
is loaded. As the recipients are a large group with mixed IT abilities, I
can forsee problems asking them to do this!

There must be another way?!

Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Subtracting Dates

Very many thanks guys - much appreciated!

"Terry Bennett" wrote in message
...
I'm sure there must be a simple way of doing this ...

I have a worksheet where the column headers (ie; cells A1:L1) are dates -
the first of each month going back for 12 months. So, A1 is 1 Nov 2007,
B1 is 1 Oct 2007, etc.

What I need is for cells B1:L1 to update automatically when I change the
value of A1 to the first of the current month. So, when A1 becomes 1 Dec
2007, I need B1 to become 1 Nov 2007, etc.

The only way I can think of doing this is by using EOMONTH. Hence, B1 =
EOMONTH(A1,-2)+1. This works OK but to use this function I had to load
one of the add-ins (Analysis Toolpak?) and I notice that when the
spreadsheet is e-mailed to users who have not loaded this, the NAME error
is shown until it is loaded. As the recipients are a large group with
mixed IT abilities, I can forsee problems asking them to do this!

There must be another way?!

Thanks.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Subtracting Dates

Just looking again at this, the EDATE solution seems to work fine but the
others come unstuck when going back beyond January as the next month becomes
1/12/2007 rather than 2006!


"Terry Bennett" wrote in message
...
I'm sure there must be a simple way of doing this ...

I have a worksheet where the column headers (ie; cells A1:L1) are dates -
the first of each month going back for 12 months. So, A1 is 1 Nov 2007,
B1 is 1 Oct 2007, etc.

What I need is for cells B1:L1 to update automatically when I change the
value of A1 to the first of the current month. So, when A1 becomes 1 Dec
2007, I need B1 to become 1 Nov 2007, etc.

The only way I can think of doing this is by using EOMONTH. Hence, B1 =
EOMONTH(A1,-2)+1. This works OK but to use this function I had to load
one of the add-ins (Analysis Toolpak?) and I notice that when the
spreadsheet is e-mailed to users who have not loaded this, the NAME error
is shown until it is loaded. As the recipients are a large group with
mixed IT abilities, I can forsee problems asking them to do this!

There must be another way?!

Thanks.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Subtracting Dates

EDATE is part of the ATP add-in just like EOMONTH so if that was the reason
you posted in the first place I don't see how it would solve the problem

Anyway, the other 2 solutions return the same values as EDATE and why would
you want to get
12/01/2006 if the date in A1 is 01/01/2008? Nothing in your OP indicates
that


--


Regards,


Peo Sjoblom



"Terry Bennett" wrote in message
...
Just looking again at this, the EDATE solution seems to work fine but the
others come unstuck when going back beyond January as the next month
becomes 1/12/2007 rather than 2006!


"Terry Bennett" wrote in message
...
I'm sure there must be a simple way of doing this ...

I have a worksheet where the column headers (ie; cells A1:L1) are dates -
the first of each month going back for 12 months. So, A1 is 1 Nov 2007,
B1 is 1 Oct 2007, etc.

What I need is for cells B1:L1 to update automatically when I change the
value of A1 to the first of the current month. So, when A1 becomes 1 Dec
2007, I need B1 to become 1 Nov 2007, etc.

The only way I can think of doing this is by using EOMONTH. Hence, B1 =
EOMONTH(A1,-2)+1. This works OK but to use this function I had to load
one of the add-ins (Analysis Toolpak?) and I notice that when the
spreadsheet is e-mailed to users who have not loaded this, the NAME error
is shown until it is loaded. As the recipients are a large group with
mixed IT abilities, I can forsee problems asking them to do this!

There must be another way?!

Thanks.





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 67
Default Subtracting Dates

Sorry, my error - does revert to 1/12/06 as required.


"Peo Sjoblom" wrote in message
...
EDATE is part of the ATP add-in just like EOMONTH so if that was the
reason you posted in the first place I don't see how it would solve the
problem

Anyway, the other 2 solutions return the same values as EDATE and why
would you want to get
12/01/2006 if the date in A1 is 01/01/2008? Nothing in your OP indicates
that


--


Regards,


Peo Sjoblom



"Terry Bennett" wrote in message
...
Just looking again at this, the EDATE solution seems to work fine but the
others come unstuck when going back beyond January as the next month
becomes 1/12/2007 rather than 2006!


"Terry Bennett" wrote in message
...
I'm sure there must be a simple way of doing this ...

I have a worksheet where the column headers (ie; cells A1:L1) are
dates - the first of each month going back for 12 months. So, A1 is 1
Nov 2007, B1 is 1 Oct 2007, etc.

What I need is for cells B1:L1 to update automatically when I change the
value of A1 to the first of the current month. So, when A1 becomes 1
Dec 2007, I need B1 to become 1 Nov 2007, etc.

The only way I can think of doing this is by using EOMONTH. Hence, B1 =
EOMONTH(A1,-2)+1. This works OK but to use this function I had to load
one of the add-ins (Analysis Toolpak?) and I notice that when the
spreadsheet is e-mailed to users who have not loaded this, the NAME
error is shown until it is loaded. As the recipients are a large group
with mixed IT abilities, I can forsee problems asking them to do this!

There must be another way?!

Thanks.







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
Subtracting Dates jaxstraww Excel Discussion (Misc queries) 0 March 28th 07 01:56 AM
Subtracting Dates BoniM Excel Discussion (Misc queries) 0 March 28th 07 12:17 AM
Subtracting dates toot033 Excel Discussion (Misc queries) 3 July 17th 06 09:03 PM
Subtracting Dates sam Excel Discussion (Misc queries) 3 March 2nd 06 12:47 PM
Subtracting dates: 8/31/05-8/1/05? dstock Excel Discussion (Misc queries) 1 July 26th 05 04:04 PM


All times are GMT +1. The time now is 04:15 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"