SOLVED

Unable to extract month from date

%3CLINGO-SUB%20id%3D%22lingo-sub-2391421%22%20slang%3D%22en-US%22%3EUnable%20to%20extract%20month%20from%20date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391421%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20have%20used%20the%20correct%20formula%20%3DTEXT(I2%2C%20%22mmm%22)%20however%20the%20month%20is%20not%20being%20extracted%20from%20the%20date.%20The%20start%20date%20column%20has%20a%20data%20type%20of%20'Date'%20and%20the%20Month%20column%20has%20a%20data%20type%20of%20'Custom'%20to%20%22mmm%22.%20Please%20help%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22milo1234_0-1622121965918.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F284285iA26252C9B53CDBFD%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22milo1234_0-1622121965918.png%22%20alt%3D%22milo1234_0-1622121965918.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2391421%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%20BI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391573%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20extract%20month%20from%20date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391573%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F972444%22%20target%3D%22_blank%22%3E%40milo1234%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESet%20the%20number%20format%20of%20the%20Month%20column%20to%20General.%3C%2FP%3E%0A%3CP%3EThe%20values%20in%20the%20Start%20Date%20column%20are%20left-aligned.%20This%20makes%20me%20suspect%20that%20they%20are%20text%20values%2C%20not%20'real'%20dates.%20What%20happens%20if%20you%20select%20(for%20example)%20I2%2C%20press%20F2%20and%20then%20press%20Enter%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391592%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20extract%20month%20from%20date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391592%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F972444%22%20target%3D%22_blank%22%3E%40milo1234%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMost%20probably%20Start%20Dates%20are%20texts%20which%20only%20looks%20like%20dates%2C%20not%20dates%20(which%20are%20actually%20numbers).%20The%20rest%20depends%20on%20which%20is%20default%20date%20format%20on%20your%20machine.%3C%2FP%3E%0A%3CP%3EAs%20variant%20you%20may%20transform%20texts%20to%20dates%20with%20Data-%26gt%3BText%20to%20Columns%20selecting%20MDY%20on%20third%20step.%3C%2FP%3E%0A%3CP%3EOr%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DTEXT(%20DATE(2021%2C%20LEFT(%5B%40%5BStart%20Date%5D%5D%2C2)%2C%201)%2C%20%22mmm%22)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391616%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20extract%20month%20from%20date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391616%22%20slang%3D%22en-US%22%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%3CBR%20%2F%3EI%20have%20changed%20the%20Month%20column%20to%20General%20and%20this%20does%20nothing.%3CBR%20%2F%3EAlso%20when%20I%20select%20I2%20press%20F2%20and%20press%20enter%2C%20nothing%20changes.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391617%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20extract%20month%20from%20date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391617%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F972444%22%20target%3D%22_blank%22%3E%40milo1234%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECould%20you%20attach%20a%20copy%20of%20the%20workbook%20without%20sensitive%2Fproprietary%20information%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2391831%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20extract%20month%20from%20date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2391831%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20find%20test%20data%20attached%2C%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hi, I have used the correct formula =TEXT(I2, "mmm") however the month is not being extracted from the date. The start date column has a data type of 'Date' and the Month column has a data type of 'Custom' to "mmm". Please help? 

 

milo1234_0-1622121965918.png

 

11 Replies

@milo1234 

Set the number format of the Month column to General.

The values in the Start Date column are left-aligned. This makes me suspect that they are text values, not 'real' dates. What happens if you select (for example) I2, press F2 and then press Enter?

best response confirmed by milo1234 (Contributor)
Solution

@milo1234 

Most probably Start Dates are texts which only looks like dates, not dates (which are actually numbers). The rest depends on which is default date format on your machine.

As variant you may transform texts to dates with Data->Text to Columns selecting MDY on third step.

Or

=TEXT( DATE(2021, LEFT([@[Start Date]],2), 1), "mmm")
Hi @Hans Vogelaar
I have changed the Month column to General and this does nothing.
Also when I select I2 press F2 and press enter, nothing changes.

@milo1234 

Could you attach a copy of the workbook without sensitive/proprietary information?

@Hans Vogelaar 

 

Please find test data attached, 

@milo1234 

Sergei Baklan already suggested using Data > Text to Columns.

Here is the result. I expanded the formulas to prevent them from returning "Jan" if the date has not been filled in.

Thank you so much Hans!

@Hans Vogelaar Hi, I have updated my data in the spreadsheet and when I go to Data > Text to Columns, the column changes the text to the actual formula.
Am I doing something wrong? 

 

milo1234_0-1623755995877.png

 

@milo1234 

Make sure the column is not formatted as Text.

If that is not the cause, make sure that the Show Formulas button on the Formulas tab of the ribbon is NOT highlighted.

Hi Hans,

The column is formatted to General and the Show Formulas button is NOT highlighted. Still have the same problem
I've fixed the issue - please ignore. Thank you