+ Reply to Thread
Results 1 to 7 of 7

Repeating an ID in multiple cells dependent on another cells value

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Miami
    MS-Off Ver
    Excel 2010
    Posts
    3

    Exclamation Repeating an ID in multiple cells dependent on another cells value

    Hello all, this is my first post, so I'm sorry if there is a thread here that addresses my questions. I could find anything to answer, so hoping someone can help :-)

    I have a hotel ID for a property lets say 1234 is the ID (column A). In the same row there are values for the number of videos associated (column B) let's say 10 and values for the number of photos associated let's say 5.

    I would like to repeat the ID 1234 in separate cells creating a vertical series of the same ID 10 times. I will use the concatenate function to build the proper URLs to the videos. Of course I will have a list of 10,000 IDs and each will have varying number of videos associated with them. Any help would be greatly appreciated and thanks in advance!

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Repeating an ID in multiple cells dependent on another cells value

    @ Georgia1,

    Welcome to the forum

    Can you please attach a sample file for better understanding?


    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Repeating an ID in multiple cells dependent on another cells value

    Assuming your ID is in A2:A4, number of videos is in B2:B4
    Separate list is from D2, number of videos is fom E2
    In D2:
    =IF(ROWS($D1:D$2)>=SUM($B$2:$B$4),"",IF(COUNTIF($D$1:D1,D1)>=SUMIF($A$2:$A$4,D1,$B$2:$B$4),INDEX($A$2:$A$4,MATCH(0,COUNTIF($D$1:D1,$A$2:$A$4),0)),D1)
    Confirmed by holding both Ctrl-Shift and Enter
    E2:
    =IF(D2="","",1)
    Drag down as far as you want
    Attached Files Attached Files
    Quang PT

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Repeating an ID in multiple cells dependent on another cells value

    Based on "bebo" example:

    Try this "none arrary" formula

    D2: =A2
    D3: =IFERROR(IF(VLOOKUP(D2,A$2:B$4,2,)>=COUNTIF(D$2:D2,D2)+1,D2,INDEX(A$2:A$4,MATCH(D2,A$2:A$4,)+1)),"")

    Normally Enter
    copy down as far as needed

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Miami
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Repeating an ID in multiple cells dependent on another cells value

    Bebo,

    Thank you so much! The first part to my problem has been solved perfectly . I have a second part:
    In the video column instead of using the IF function to reapeat "1" if there is a value I would like to have listed, begining from "0", the amount of times that ID appears. See attached example:

    Any help is greatly appreciated!
    Attached Files Attached Files

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Repeating an ID in multiple cells dependent on another cells value

    In E2 cell
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag it down......

  7. #7
    Registered User
    Join Date
    01-22-2013
    Location
    Miami
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Repeating an ID in multiple cells dependent on another cells value

    Thanks you all, worked great. Fantastic resource and much appreciated!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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