View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default formula required

On Wed, 24 Dec 2008 15:16:01 -0800, Igneshwara reddy
wrote:

Hi,

I have a data in column A for 800 lines.

Column A Column B Column C Column D Column E
123 3 123-002 123-003 123-004
432 2 432-002 432-003

As defined above, the data what I have in Column A should be counted the
number of times in Column B and it has to repeated so many times in different
columns with the sequence of 002, 003 004 etc., The sequence should start
only from 002 and should continue to the number of times it has to be
repeated.

Please help me out.

Regards,
Igneshwara Reddy.



Try the following formula in cell C2

=IF($B2COLUMN()-2,$A2&"-"&RIGHT("000"&COLUMN()-1,3),"")

Copy cell C2 as far to the right as needed to cover the maximum times.
Then copy down from row 2 to row 801.

Hope this helps / Lars-Åke