+ Reply to Thread
Results 1 to 5 of 5

Turn Columns into Rows, with a catch

Hybrid View

  1. #1
    Registered User
    Join Date
    04-15-2016
    Location
    Chicago, IL
    MS-Off Ver
    365
    Posts
    2

    Turn Columns into Rows, with a catch

    I'm trying to turn sales funnel stages into a "path", showing each stage of the sales funnel in a single row. Currently the date is in two columns (old stage and new stage) and the path is shown in the old stage as a single column, multiple rows. The catch is that the final stage is in the 'new stage' column. What I need is to get each stage in it's own cell in rows, not columns, and include the final stage as well. Attached is a spreadsheet that shows the exported data on the left and the desired data on the right. Hopefully someone can help.
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2505
    Posts
    13,764

    Re: Turn Columns into Rows, with a catch

    Hi, jasonwebber

    Welcome to the forum.

    I don't understand the description, and cannot relate it to the workbook. Could you re-upload with desired results hand-typed in?

    Thanks.
    Dave

  3. #3
    Registered User
    Join Date
    04-15-2016
    Location
    Chicago, IL
    MS-Off Ver
    365
    Posts
    2

    Re: Turn Columns into Rows, with a catch

    Dave, the results are typed in, it's the J-N columns that should be the output. Columns C-H is the raw data that needs to be transformed, and the bolded cells are what I'd like to get put into a single row. Hope that helps, and thanks in advance for your advice.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Turn Columns into Rows, with a catch

    Hi Jason

    Welcome to the Forum!!!

    A VBA solution...try this Code in the attached...CTRL +x will fire the Code.

    Option Explicit
    
    Sub Test_Stages()
       Dim ws           As Worksheet
       Dim FR           As Long
       Dim LR           As Long
       Dim i            As Long
       Dim j            As Long
    
       Set ws = Sheets("Sheet1")
    
       Application.ScreenUpdating = False
       With ws
          FR = 5
          j = 5
          LR = .Cells.Find("*", .Cells(.Rows.Count, .Columns.Count), SearchOrder:=xlByRows, _
                           SearchDirection:=xlPrevious).Row
          For i = FR To LR + 1
             .Cells(FR - 1, FR + j).Value = j - 4 & "-Stage"
             j = j + 1
          Next i
    
          .Range(.Cells(FR, "F"), .Cells(LR, "F")).Copy
          .Cells(FR, "J").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
                                       False, Transpose:=True
          .Cells(FR, "N").Value = .Cells(LR, "G").Value
       End With
       Application.CutCopyMode = False
       Application.ScreenUpdating = True
    
    End Sub
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2505
    Posts
    13,764

    Re: Turn Columns into Rows, with a catch

    I am just guessing that the live data does not follow a pattern "Stage #" where it follows position and numeric patterns as in the upload. Is that correct?

    Edit In the meantime this works with the data and layout provided. Try this formula in J5 filled / copied across to N5
    Formula: copy to clipboard
    =IFERROR(INDEX($F$5:$F$8,MATCH(SUBSTITUTE(TRIM(MID(SUBSTITUTE(J$4&"/"&J$4,"-",REPT(" ",256)),256,256)),"/"," "),$F$5:$F$8,0)),INDEX($G$5:$G$8,MATCH(SUBSTITUTE(TRIM(MID(SUBSTITUTE(J$4&"/"&J$4,"-",REPT(" ",256)),256,256)),"/"," "),$G$5:$G$8,0)))
    Last edited by FlameRetired; 04-18-2016 at 05:49 PM.

+ 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. [SOLVED] Turn rows into columns
    By kleptilian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2015, 01:54 PM
  2. [SOLVED] Turn 2 columns into rows, but keep 1st column
    By nobrain82 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-05-2014, 09:18 AM
  3. Help turn some rows into into columns
    By wholesaleheatin in forum Excel General
    Replies: 1
    Last Post: 11-04-2006, 11:40 AM
  4. how do I turn rows into columns
    By Madigan in forum Excel General
    Replies: 2
    Last Post: 08-11-2005, 05:05 PM
  5. turn columns into rows
    By chippy in forum Excel General
    Replies: 1
    Last Post: 03-26-2005, 04:06 PM
  6. Turn Rows into Columns
    By Marianna in forum Excel General
    Replies: 1
    Last Post: 02-03-2005, 08:37 AM
  7. Turn Rows into Columns
    By Marianna in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-02-2005, 07:06 PM

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