I need to covert a list of years from this format
2005-2008
2009-2009
2009-2012
2009-2014
to
2005, 2006, 2007 ,2008
2009
2009, 2010, 2011, 2012
2009, 2010, 2011, 2012, 2013, 2014
Any help with a formula to do this would be great.
I need to covert a list of years from this format
2005-2008
2009-2009
2009-2012
2009-2014
to
2005, 2006, 2007 ,2008
2009
2009, 2010, 2011, 2012
2009, 2010, 2011, 2012, 2013, 2014
Any help with a formula to do this would be great.
Maybe like this
Formula:![]()
=IF(LEFT($A1,4)+COLUMNS($A:A)-1>RIGHT($A1,4)+0,"",LEFT($A1,4)+COLUMNS($A:A)-1)
Data Range
A B C D E F G 1 2005-2008 2005 2006 2007 2008 2 2009-2009 2009 3 2009-2012 2009 2010 2011 2012 4 2009-2014 2009 2010 2011 2012 2013 2014
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
Thanks but that doesn't seem to format it correctly, I need to to end up in one cell and formatted like this
2009-2014 would have to be 2009, 2010, 2011, 2012, 2013, 2014
![]()
Function arr(rng As Range) As String Dim sy As Integer Dim fy As Integer Dim i As Integer sy = Left(rng, 4) fy = Right(rng, 4) arr = "" For i = sy To fy arr = arr & i & ", " Next i arr = Left(arr, Len(arr) - 2) End Function
Data in A1
in B1 =arr(A1)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks