+ Reply to Thread
Results 1 to 4 of 4

Copy and increment code based on collumn value

  1. #1
    Registered User
    Join Date
    01-16-2014
    Location
    France
    MS-Off Ver
    Excel 2010
    Posts
    14

    Copy and increment code based on collumn value

    Hi,

    Originals:
    I have these two collumns, one gives me a code, and another gives me the number of times that codes has to be repeated.

    Step 1:
    First I have to take all the rows where the number is bigger than 1 and duplicate it the number of times written in the code cell.

    Step 2:
    Then I have to add another cell with a new code that makes a difference between the repeats, for example, .a / .b / .c / if the number in the cell is 3. If it is larger than 3, actually for example larger than 40, at the end of the alfabet I have to restart with aa, bb, cc.

    Also adding to this complexity I cannot use certain letters, like i and o. So I'm thinking I should define what letters I can use based on how big is the number in a separate place, although I'm not sure.

    End result:
    At the end I should be left whith two rows, one where the number is alsways equal to 1 and another with the new code.

    Question:
    I've been doing these manually thus far, however I think there should be an automatic way of doing it but it escapes me.

    Attached you can find a file containing the steps outlined above: Example_AV_160125.xlsx

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Copy and increment code based on collumn value

    Created Helper Column in Column D and used below formulas
    D4
    Please Login or Register  to view this content.
    Copy D4 and paste from D5:D11
    and
    E4
    Please Login or Register  to view this content.
    Try this formula and copy towards down

    See the attached file
    Attached Files Attached Files
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    01-16-2014
    Location
    France
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Copy and increment code based on collumn value

    Thanks for the quick response.

    However I'm having dificulties wrapping my head around the formulas you used and why you used them. I've never seen it used in such a place but I'm guessing the & is used as a substitute for and. but how exactly does the rows formula come into use here? and why? Also why create the D column?

    Could you plese explain the formula a bit so I can better understand it and possible learn from it, if you have the time?

    Later edit:

    Also if it would help make things easier, I would prefer 4 columns of formulas instead of 1, as long as I can easily understand what's going on in the formulas.
    Last edited by ALecsx; 01-25-2016 at 09:07 AM.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Copy and increment code based on collumn value

    Quote Originally Posted by ALecsx View Post
    Thanks for the quick response.

    However I'm having dificulties wrapping my head around the formulas you used and why you used them. I've never seen it used in such a place but I'm guessing the & is used as a substitute for and. but how exactly does the rows formula come into use here? and why? Also why create the D column?

    Could you plese explain the formula a bit so I can better understand it and possible learn from it, if you have the time?

    Later edit:

    Also if it would help make things easier, I would prefer 4 columns of formulas instead of 1, as long as I can easily understand what's going on in the formulas.
    step by step formula
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Name range based on row and collumn header
    By dave1983 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-31-2015, 12:32 PM
  2. [SOLVED] Code to copy formula down collumn
    By bouncingbudha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2014, 08:09 PM
  3. Macro to copy simple Sum down the collumn
    By bouncingbudha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2014, 05:11 PM
  4. Increment date to next day after each printed sheet copy [CODE FIX]
    By gtaaccord in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2014, 09:58 AM
  5. [SOLVED] Find a collumn in a dynamic sheet and select the entire collumn
    By Armand0 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2014, 11:20 AM
  6. Replies: 3
    Last Post: 06-09-2009, 07:23 AM
  7. Macro to Copy One Collumn to the Next
    By JohnOB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2006, 09:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1