Splitting Year

Jesan

New Member
Joined
Mar 16, 2016
Messages
11
Hello,

Good day.

I would like to ask if there's a way wherein I can split this kind of year 2009-2015 into each year?

2009
2010
2011
2012
2013
2014
2015

Thank you in advance.

Yours,
Jesan
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You want to split the text 2009-2015 into 2009, 2010,2011,2012...2015?
which version of excel do you have?
If you have 365or2021:
=LET(
st, A1,
ld, 1* LEFT(A1,4),
rd, 1* RIGHT(A1,4),
SEQUENCE(1,rd-ld+1,ld,1))
 
Upvote 0
WorkBook1.xlsx
ABCDEFGH
12009-2015
22009201020112012201320142015
3
Sheet3
Cell Formulas
RangeFormula
A2:G2A2=LET( st, A1, ld, 1* LEFT(A1,4), rd, 1* RIGHT(A1,4), SEQUENCE(1,rd-ld+1,ld,1))
Dynamic array formulas.
 
Upvote 0
With Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Column1.1", "Column1.2"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Column1.1", Int64.Type}, {"Column1.2", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each {[Column1.1]..[Column1.2]}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Removed Other Columns" = Table.SelectColumns(#"Expanded Custom",{"Custom"})
in
    #"Removed Other Columns"

Book12
ABC
1Column1Custom
22009-20152009
32010
42011
52012
62013
72014
82015
Sheet1
 
Upvote 0
Please update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Simpler version of the earlier formula suggestion, assuming you have the SEQUENCE function

23 02 14.xlsm
A
12009-2015
22009
32010
42011
52012
62013
72014
82015
9
SEQ
Cell Formulas
RangeFormula
A2:A8A2=SEQUENCE(RIGHT(A1,4)-LEFT(A1,4)+1,,LEFT(A1,4))
Dynamic array formulas.


If you do not have SEQUENCE, then

23 02 14.xlsm
A
12009-2015
22009
32010
42011
52012
62013
72014
82015
9 
10 
SEQ (2)
Cell Formulas
RangeFormula
A2:A10A2=IF(IFNA(LOOKUP(9999,A$1:A1),0)-RIGHT(A$1,4)=0,"",LEFT(A$1,4)+ROWS(A$2:A2)-1)
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top