+ Reply to Thread
Results 1 to 3 of 3

Transposing Columns to Row based on Cell Contents

  1. #1
    Registered User
    Join Date
    07-09-2015
    Location
    Pennsylvania
    MS-Off Ver
    O365
    Posts
    1

    Transposing Columns to Row based on Cell Contents

    Hi Everyone,

    I'm trying to import data from Excel into ArcMap and I'm running across some issues with a database. Basically I need each building (row) to contain links to all drawing data. Different buildings may have different numbers of drawings.

    Basically I want to convert something that looks like this:

    Capture.JPG

    Into something that looks like this:

    Capture2.JPG

    The database is quite large so doing this manually is pretty much out. I do know the max number of columns I'd need per building by using a "COUNTIF" function so I know how many rows to title.

    Any help would be great. Thank you

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Transposing Columns to Row based on Cell Contents

    First, make your headings in row 1.

    Then, in C2, enter the formula

    =IF($A2=OFFSET($A2,COLUMN(A1),0),OFFSET($B2,COLUMN(A1),0),"")

    and copy to the right for as many columns as you need, then copy down to match your list.

    Copy all your cells, paste values, then select all the cells and use Remove Duplicates, based on column A only. And you're done.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Transposing Columns to Row based on Cell Contents

    Personally, I wouldn't do what you are asking. It is adding a complication to your data. All the data for a building can be extracted by filtering and /or sorting to get the data together. This keeps the size of the workbook to a minimum and there are no complications of not preparing for the amount of data that you may have. You may have prepared for 15 records when you actually have 20 or more with the list growing.

    If you really want to go horizontal, here is a solution that you can expand horizontally as required.

    Enter the column Headings in D1:N1 (to start) D1 will be Building and under that the buildings will be entered using this formula starting in D2 to extract a unique listing of all the buildings in column A.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is an ARRAY FORMULA so enter with Ctrl + Shift + Enter

    In E2 enter this formula and fill across and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is also an ARRAY FORMULA so enter with Ctrl + Shift + Enter

    The result will be:
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    1
    Building Drawing 1 Drawing 2 Drawing 3 Drawing 4 Drawing 5 Drawing 6 Drawing 7 Drawing 8 Drawing 9 Drawing 10
    2
    A
    1
    2
    3
    3
    3
    4
    5
    3
    B
    6
    7
    8
    8
    8
    9
    4
    C
    10
    11
    5
    D
    12
    6
    E
    13
    14
    15
    15
    15
    7
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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. Transposing a single column to 3 or 4 columns based on ranking
    By Ian McPherson in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-23-2014, 07:50 PM
  2. Adjusting Range Contents Based on contents of Three other columns
    By VTHokie11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2012, 01:55 PM
  3. Transposing one column data to different columns based on their headings
    By bipindurgapal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2012, 06:35 AM
  4. Replies: 0
    Last Post: 05-12-2011, 04:24 PM
  5. Analyzing cell contents, inserting a number of rows, and transposing
    By james_black in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-15-2010, 11:28 PM

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