+ Reply to Thread
Results 1 to 9 of 9

Transpose names from horizontal to vetical

Hybrid View

zbor Transpose names from... 09-21-2009, 08:58 AM
DonkeyOte Re: Transpose names from... 09-21-2009, 09:06 AM
GuruWannaB Re: Transpose names from... 09-21-2009, 09:07 AM
martindwilson Re: Transpose names from... 09-21-2009, 09:14 AM
zbor Re: Transpose names from... 09-21-2009, 09:14 AM
NBVC Re: Transpose names from... 09-21-2009, 09:17 AM
zbor Re: Transpose names from... 09-21-2009, 09:27 AM
DonkeyOte Re: Transpose names from... 09-21-2009, 09:29 AM
zbor Re: Transpose names from... 09-21-2009, 09:35 AM
  1. #1
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Transpose names from horizontal to vetical

    XL 2003

    Am I tired so don't see solution?

    Transpose names without blanks:

    Book1.xls
    Last edited by zbor; 09-21-2009 at 09:17 AM.
    Never use Merged Cells in Excel

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Transpose names from horizontal to vetical

    Given duplicity of names I would say you need an Array, eg:

    B3:
    =INDEX($A$1:$N$1,SMALL(IF($E$1:$N$1<>"",COLUMN($E$1:$N$1)),ROWS(B$3:B3)))
    confirmed with CTRL + SHIFT + ENTER
    copied down
    Best to conduct a COUNTA elsewhere to determine how many times the Array is required, eg:

    B2: =COUNTA(E1:N1)
    And use that as a precursor in B3

    =IF(ROWS(B$3:B3)>$B$2,"",INDEX(....))
    confirmed with CTRL + SHIFT + ENTER
    copied down

  3. #3
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Re: Transpose names from horizontal to vetical

    You can do this the long way....

    Selecting your row of data -> Copy
    Select the top row of where you want to horizontally transpose it -> Paste Special -> Transpose -> Edit -> Go To -> Special -> Blanks -> Delete

    Or macro it out to something like:
    ' Macro TransposeAndDeleteBlanks
    '
    
    Range("e1:N1").select
    'Change the above range to meet your needs of what you are transposing
    
    Selection.copy
    
    Range("b3").select 
    'Change the above range to o where you want to transpose to
    
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
        Selection.SpecialCells(xlCellTypeBlanks).Select
        Application.CutCopyMode = False
        Selection.Delete Shift:=xlUp
    
    End Sub
    Last edited by GuruWannaB; 09-21-2009 at 09:22 AM.
    I help because of the Pavlovian dog that resides in the inner me...so if you are happy with the results, please add to my reputation. It helps keep me motivated!



    Please mark your threads as Solved once it is solved. Check the FAQ's to see how.

  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: Transpose names from horizontal to vetical

    or just put
    =COUNTA($E$1:E1) in e2 drag across then
    index match

    =INDEX($E$1:$N$1,MATCH(ROWS($A$1:A1),$E$2:$N$2,0)) dragged down
    you can remove duplicates later with advanced filter if required.
    "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

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: Transpose names from horizontal to vetical

    Great!, Works!

    Yes, forgot to say.. I tried to avoid extra row...
    Last edited by zbor; 09-21-2009 at 09:18 AM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Transpose names from horizontal to vetical

    zbor, for the benefit of future users who are looking up similar topic, it is best to tell us if you tried all suggestions and which of the suggestions worked.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: Transpose names from horizontal to vetical

    When I saw martinwillson I realize that it's the way I'll do usually
    Well, it's end of workday, my brain stopped.

    But before I saw it, I've tested DQ solution and works great (didn't doubt). However, I've need some time to adjust.

    I didn't try macro (prefere non-macro solutions.. but one day I'll learn it... it's just not that day yet )

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Transpose names from horizontal to vetical

    You can do macro-less using the same approach -- assuming E1:N1 are either constants or blanks (not formula nulls)...

    Highlight E1:N1 -> F5 -> Special -> Constants -> OK -> CTRL + C -> B3 -> ALT + E -> S -> V -> ALT + E -> OK

  9. #9
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: Transpose names from horizontal to vetical

    Here are both solutions:

    Book1.xls

+ 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