I have a problem that I'm sure there is a formula that can perform this function.
I have a list of numbers, some are consecutive and some are outliers. I need to take this data and create a "From" "To" column on those numbers that are consecutive. Below is an example of the data that I have and an example of what I need this data to look. There are about 16000 rows and 1 columns filled with data like this:
Current data
110001
110002
110003
110004
110005
110006
110007
110008
110009
110010
121000
121001
121002
121003
121004
121005
121006
121007
121008
121010
121012
121013
121015
121101
121102
To this:
110001...110010
121000...121008
121010...121102
Please help. I appreciate any help that can be provided.
Update:
I found a possible solution on another forum, but it didn't work for me. Posting it here if it may help. The result for that is in the image.
Enter below formula as an array formula in cell C2 & copy down:
=IF(MAX($C$1:D1)=MAX($A$2:$A$20),"",MIN(IF($A$2:$A$20<>"",IF($A$2:$A$20>MAX($C$1:$D1),$A$2:$A$20))))
Enter below formula as an array formula in cell D2 & copy down:
=IF(INDEX($A$2:$A$20,SMALL(IFERROR(IF(($A$3:$A$20-$A$2:$A$19=1)=FALSE,ROW($A$2:$A$20)-ROW($A$2)+1),1E+100),ROW(1:1)))-INDEX($A$2:$A$20,SMALL(IFERROR(IF(($A$3:$A$20-$A$2:$A$19=1)=FALSE,ROW($A$2:$A$20)-ROW($A$2)+1),1E+100),ROW(1:1))-1)=1,INDEX($A$2:$A$20,SMALL(IFERROR(IF(($A$3:$A$20-$A$2:$A$19=1)=FALSE,ROW($A$2:$A$20)-ROW($A$2)+1),1E+100),ROW(1:1))),"")
I have a list of numbers, some are consecutive and some are outliers. I need to take this data and create a "From" "To" column on those numbers that are consecutive. Below is an example of the data that I have and an example of what I need this data to look. There are about 16000 rows and 1 columns filled with data like this:
Current data
110001
110002
110003
110004
110005
110006
110007
110008
110009
110010
121000
121001
121002
121003
121004
121005
121006
121007
121008
121010
121012
121013
121015
121101
121102
To this:
110001...110010
121000...121008
121010...121102
Please help. I appreciate any help that can be provided.
Update:
I found a possible solution on another forum, but it didn't work for me. Posting it here if it may help. The result for that is in the image.
Enter below formula as an array formula in cell C2 & copy down:
=IF(MAX($C$1:D1)=MAX($A$2:$A$20),"",MIN(IF($A$2:$A$20<>"",IF($A$2:$A$20>MAX($C$1:$D1),$A$2:$A$20))))
Enter below formula as an array formula in cell D2 & copy down:
=IF(INDEX($A$2:$A$20,SMALL(IFERROR(IF(($A$3:$A$20-$A$2:$A$19=1)=FALSE,ROW($A$2:$A$20)-ROW($A$2)+1),1E+100),ROW(1:1)))-INDEX($A$2:$A$20,SMALL(IFERROR(IF(($A$3:$A$20-$A$2:$A$19=1)=FALSE,ROW($A$2:$A$20)-ROW($A$2)+1),1E+100),ROW(1:1))-1)=1,INDEX($A$2:$A$20,SMALL(IFERROR(IF(($A$3:$A$20-$A$2:$A$19=1)=FALSE,ROW($A$2:$A$20)-ROW($A$2)+1),1E+100),ROW(1:1))),"")