Thread: Date "yyyymm"
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Date "yyyymm"

On Tue, 15 Dec 2009 06:31:02 -0800, Memphis
wrote:

I have a worksheet were the dates are displayed as 200901 (yyyymm --- no
slash) in column A.
I need to add a formula to cells in colum C that will only substract any
given number of months from this date, such as 200901 minus 13 months will
equal 200811. Now, on the same boat, I would like to show the new date
displayed as 11/01/2008.

Thank you


I guess I don't understand your math.

I would interpret 200901 to be 2009 Jan and, since the day is not specified, to
be the first of Jan. In other words, 200901 -- Jan 1st, 2009

How do you subtract 13 months from that and get Nov 1st, 2008?

If I subtract 13 months, I would think the correct answer should be Dec 1st,
2007.

If my assumptions are incorrect, please clarify.

If your examples are incorrect, then try:

A1: 200901
B1: -13 (months to add/subtract)
C1: =DATE(LEFT(A1,4),RIGHT(A1,2)+B1,1)

Format C1 as mm/dd/yyyy
--ron