Thursday, December 17, 2009

How can I convert a range to a list of consecutive numbers in excel?

Say for example I have the value ';1-100'; in a cell, how can i automate this too list 1 to 100 in consecutive cells?How can I convert a range to a list of consecutive numbers in excel?
If you have 1-100 in A1, put this formula somewhere (let's say in A2), to find the initial value (1):





=VALUE(LEFT(A1, FIND(';-';,A1)-1))





Then put this formula in A3 and copy down, to fill in 2,3, ... to 100:





=IF(A2=';';,';';, IF(A2+1 %26lt;= VALUE(MID($A$1, FIND(';-';,$A$1)+1,100)), A2+1,';';))





If you need more info, add more details or e-mail.


Good luck.


.

No comments:

Post a Comment