+ Reply to Thread
Results 1 to 12 of 12

How to make cells repeat themselves a vertain number of times in a when used in labels

  1. #1
    Registered User
    Join Date
    08-01-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    8

    How to make cells repeat themselves a vertain number of times in a when used in labels

    I use an Excell sheet to Generate Box/Reel number and Lot No. labels when my shipment arrives. However while production, I need to print multiple labels of the same number (based on the no of pcs that lot has produced) and the print again 'x' number of labels of the next lot.

    Currently i enter all the lots i recd in an excell sheet, and mail merge it. (thats ok for labeling the input material)
    for the output material I need say ; 10 labels of Lot 1, 15 Labels of lot 2.

    Like when I get material my sheet for mail mergo looks like

    230 342 13221 426 19.15
    231 342 13221 425 18.90
    232 342 13221 424 19.90
    233 342 13221 423 19.55
    234 342 13221 420 22.40
    235 342 13221 419 22.05

    and when i got for final product labelling it should look like :

    230 342 13221 426 19.15
    230 342 13221 426 19.15
    230 342 13221 426 19.15
    230 342 13221 426 19.15
    230 342 13221 426 19.15
    233 342 13221 423 19.55
    233 342 13221 423 19.55
    235 342 13221 419 22.05
    235 342 13221 419 22.05
    235 342 13221 419 22.05
    235 342 13221 419 22.05
    235 342 13221 419 22.05
    235 342 13221 419 22.05

    and so on ...

    Any way we can do it without having to paste the same cell a number of times ...

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    sorry what bit is the lot number and where is the info that says how many of each you need?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    08-01-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    Oh, sorry forgot to enter that. Actually the numbers in col B,C & D - combine together to form the lot number. However, we have given a unique Number in Col A which a new number for each lot. Column E is the weight of each lot, and Colomn F is the number of times this lost has to repeat when stickers are mail merged.


    A B C D E F
    230 342 13221 426 19.15 14
    231 342 13221 425 18.90 15
    232 342 13221 424 19.90 14
    233 342 13221 423 19.55 14
    234 342 13221 420 22.40 26
    235 342 13221 419 22.05 27

    Curently, what I have done is , in a new sheet entered the UniqueNo (col A) and Vlookup'ed up and gotten the values in Col B,C,D &F. Pulled down the unique no, the no of time it is mentioned in coloumn F . and then started mail merge !!

    but if there is a simpler easier way !!

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    this will produce a list like you require
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-01-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    Many thanks for such a prompt reply. What does the column H do in the list, where the formula is : =IF(A1="","",F1+H1)

    what condition do u fullfill with A1="" ? or what is false in "" ? could u just explain and i an curious to what went behind the scene in the thought process.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    column h gives the list for the lookup to refer to {1,15,30,44,58,84,111}
    and also ROW($A$1:$A$10000) creates a range {1,2,3,4,5,6.....999,1000}
    =IF(A1="","",F1+H1) if a1 is blank return blank which is "" you dont want anything if a1 is blank

    what the lookup does is gets the row to use in the index function so if you lookup rows($a$1:a5) which is = to 5
    =lookup(5,{1,15,30,44,58,84,111},{1,2,3,4,5,6.....999,1000})
    lookup matches with the first number < or = to 5 which is 1 so 1 is used in the row argument of index
    if you lookup rows($a$1:a35) which is = to 35
    =lookup(35,{1,15,30,44,58,84,111},{1,2,3,4,5,6.....999,1000}) would match 30 which would return 3
    so all numbers between 30 and 43 would reference row 3 of the index giving 14 instances of row 3

  7. #7
    Registered User
    Join Date
    08-01-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    Awesum thought process. I guess i will have to create it once to see how it actually works.

    In the meantime, I need to add row on the top of the file u created to add relevent coloumn heading When i do that , some rows in the repeated section show them selfs as NA .. and this cant add coloumn header. Could you please redo the same by adding two rows on the top.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    there you go
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-01-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    Thanks a lot martin ... It made my work super easy, and I have gotten the hang of working with the Index command as well. The index command is pretty much similiar to the Vlook up ? Whats the difference then ?

    and one more help, when we repeat the rows, as in the formula made by you, can one coloumn in the repeated rows carry a contineous number (increasing till the number or repeats) that could be suffied with the unique number using concatanate command ? Like how many of one unique number were repeated .. eg. 231/1, 231/2, 231/3, 231/4, 267/1, 267/2, 267/3, 897/1 ..

    I am attaching the work sheet i am working on
    Can we get what i have put in col M, then col N, is easy to get ? or is there anothr simpler way to get around this ?

    Thnaks in advance !!

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    no attachment but easiest way is another column with countif()
    Attached Files Attached Files
    Last edited by martindwilson; 03-18-2013 at 06:42 AM.

  11. #11
    Registered User
    Join Date
    08-01-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    yeah Count if ..seems easy .. .. i had actually solved it using IF(L2=L1,M1+1,1), to check if current row equals the one above, and add an increamnet to the counter, else reset to 1 !! Attaching sheet here ...
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    08-01-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: How to make cells repeat themselves a vertain number of times in a when used in labels

    Hi Martin,,

    I had put this thread, but no decent replies ..cud u help me on this ?

    http://www.excelforum.com/excel-prog...67#post3166367

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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