+ Reply to Thread
Results 1 to 7 of 7

No of times names to be repeated

  1. #1
    Forum Contributor
    Join Date
    08-22-2010
    Location
    mumbai
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    179

    No of times names to be repeated

    Hi,
    I have data as below
    Column A Column B
    Tom 2
    Sam 3
    Jerry 4
    Ford 1

    my requirement is that in the column c
    I need
    Tom
    Tom
    Sam
    Sam
    Sam
    Jerry
    Jerry
    Jerry
    Jerry
    Ford

    So basically for i want to repeat the names as per the no mentioned in the column B. As for Tom it is 2 so Tom should be two times so on

    This just begin ex Column A will be more than 100 names

    Hope your expertise will help me solve this.

    Thanks in advance


    This is just an example

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: No of times names to be repeated

    Enter this array formula in C2 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ***Array formula
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.
    You will know the array is active when you see curly braces { } appear around your formula.
    If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    v A B C
    1
    2 Tom 2 Tom
    3 Sam 3 Tom
    4 Jerry 4 Sam
    5 Ford 1 Sam
    6 Sam
    7 Jerry
    8 Jerry
    9 Jerry
    10 Jerry
    11 Ford
    12
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    08-22-2010
    Location
    mumbai
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    179

    Re: No of times names to be repeated

    Thanks Alkey it is working for the range i have given in the example but if i try to change to 99 rows it is showing blank where i am going wrong please guide me. Also i am using excel 2007.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: No of times names to be repeated

    Here's another one.

    Data Range
    A
    B
    C
    1
    Name
    Repeat
    Name
    2
    Tom
    2
    Tom
    3
    Sam
    3
    Tom
    4
    Jerry
    4
    Sam
    5
    Ford
    1
    Sam
    6
    Sam
    7
    Jerry
    8
    Jerry
    9
    Jerry
    10
    Jerry
    11
    Ford
    12


    This array formula** entered in C2:

    =IF(ROWS(C$2:C2)>SUM(B:B),"",INDEX(A$2:A$5,MATCH(TRUE,COUNTIF(C$1:C1,A$2:A$5) < SUMIF(A$2:A$5,A$2:A$5,B$2:B$5),0)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

    Note that if a name repeats in column A:

    Tom...2
    Bob...1
    Tom...1

    It'll show up in column C like this:

    Tom
    Tom
    Tom
    Bob
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: No of times names to be repeated

    I don't where you going wrong. So here an adjusted formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: No of times names to be repeated

    Quote Originally Posted by goodboy View Post
    Also i am using excel 2007.
    Please update your profile to indicate that.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: No of times names to be repeated

    Quote Originally Posted by Tony Valko View Post
    Note that if a name repeats in column A:

    Tom...2
    Bob...1
    Tom...1

    It'll show up in column C like this:

    Tom
    Tom
    Tom
    Bob
    If there might be repeats in column A:

    Tom...2
    Bob...1
    Tom...1

    And you want them to appear separately in column C like this:

    Tom
    Tom
    Bob
    Tom

    Just let me know.

+ 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. Identify accounts repeated more than 3 times
    By Pbb1008 in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 06-20-2016, 11:15 PM
  2. [SOLVED] Number of times same text is repeated
    By fedfed in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2014, 07:43 AM
  3. Replies: 5
    Last Post: 01-22-2014, 04:39 PM
  4. [SOLVED] Filtering repeated names to get a list of unique names
    By grumpyguppy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-06-2014, 11:48 PM
  5. vba for Autofilter if the name on a column repeated >=20 times
    By anto_01 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2012, 04:45 PM
  6. Count No. of times Dates are repeated
    By Mandeep Dhami in forum Excel General
    Replies: 6
    Last Post: 12-07-2005, 11:00 PM
  7. find out number repeated max. times in column.
    By vimivijay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2005, 06:59 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