Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Question Extract Month and year from Cell containing date, month, year & time

How do I extract month and year to a single cell from a cell that contains dd/mm/yyyy hh:mm:ss?

By way of example:
Cell A2 contains, 4/01/2011 11:25:30 AM

Cell B2 to contain, Jan 2011
(However, it is not to carry over any of the non required data from cell A1.. That is, I don't want day or time)

Outcome is a Pivot Table that tracks order fulfillment - Orders submitted in a month and completions for the month and months that follow.

Mick
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,045
Default Extract Month and year from Cell containing date, month, year & time

On Tue, 1 May 2012 23:52:01 +0000, Montenegro Mick wrote:

How do I extract month and year to a single cell from a cell that
contains dd/mm/yyyy hh:mm:ss?

By way of example:
Cell A2 contains, 4/01/2011 11:25:30 AM

Cell B2 to contain, Jan 2011
(However, it is not to carry over any of the non required data from cell
A1.. That is, I don't want day or time)

Outcome is a Pivot Table that tracks order fulfillment - Orders
submitted in a month and completions for the month and months that
follow.


There is no need to do that if your dates are going to be in the rows of the Pivot Table. Once you set up your Pivot table, right-click in the rows area, and select to group by months (or months and years if that's what you want).

In any event, if you want the value in B2 to be a date, it MUST contain the day. Otherwise you could have it as a text string, using something like:
B2: =text(a2, "mmm yyyy")

  #3   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by Montenegro Mick View Post
How do I extract month and year to a single cell from a cell that contains dd/mm/yyyy hh:mm:ss?

By way of example:
Cell A2 contains, 4/01/2011 11:25:30 AM

Cell B2 to contain, Jan 2011
(However, it is not to carry over any of the non required data from cell A1.. That is, I don't want day or time)

Outcome is a Pivot Table that tracks order fulfillment - Orders submitted in a month and completions for the month and months that follow.

Mick
Hi Mick,

In B2 enter =EOMONTH(A2,-1)+1 then format it to mmm/yyyy

What is does is force all the dates to be the first day of their respective month. Then when formatted as you desire they can be used in pivots etc. and the time element is it ignored.

Hope that helps.

S.
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
How do you extract day/time/month/year information SV[_2_] Excel Worksheet Functions 7 February 4th 10 02:10 PM
count month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
Tell me which "season" (Month/Day through Month/Day) a date(Month/Day/Year) falls in (any year)??? misscrf Excel Discussion (Misc queries) 1 December 14th 07 02:59 PM
Sort month/date/year data using month and date only SMW820 Excel Discussion (Misc queries) 6 June 22nd 06 05:14 PM
trying to get day/month/year froamt while user enters year only RADIOOZ New Users to Excel 3 June 7th 06 05:30 AM


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