+ Reply to Thread
Results 1 to 2 of 2

concatenate cell values based on row number

  1. #1
    Registered User
    Join Date
    07-02-2007
    Posts
    1

    concatenate cell values based on row number

    Hi -

    I have a huge list of cities and the users they are served by. The format looks lke this:

    column A = row # (1, 2, 3, etc.), column B = username, column C = City

    I have column B sorted by username ascending. It looks like this:

    1 | Doug | New York
    2 | Doug | Boston
    3 | Doug | Cambridge
    4 | Bob | New York

    What I did was put this formula in column 4:
    =IF(B3<>B2, A3, E2)

    so that it now looks like this:

    1 | Doug | New York | 1
    2 | Doug | Boston | 1
    3 | Doug | Cambridge | 1
    4 | Bob | New York | 4

    so basically it has the row number of the first occurrence of that username. The reason I want this is I need to concatenate all of the cities that each username serves, and I figured I could do this by doing something like:

    if(D4 <> D3, concatenate(D[Value of D3]:D[Value of D4 - 1]), "")

    But I have no idea how to reference the value of a cell and use it as another cell's row number. Is this possible? And can anyone think of a better way to do this?

  2. #2
    Registered User
    Join Date
    06-06-2007
    Posts
    53
    Use INDIRECT:

    if(D4 <> D3, concatenate(INDIRECT("D" & D3 & ":D" & D4 - 1)), "")

+ 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