+ Reply to Thread
Results 1 to 16 of 16

A Simple Formula/Helper Column To Transpose a Range

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    A Simple Formula/Helper Column To Transpose a Range

    Hi,

    I want to transpose a range to a single column.( Blanks in the range should be avoided)
    I have previously used an array formula for the same ; but would like to do it using a simpler formula (or even using helper columns)

    Attached file for reference.


    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,999

    Re: A Simple Formula/Helper Column To Transpose a Range

    Try

    F2
    Formula: copy to clipboard
    =INDEX(CHOOSE(MOD(ROWS($A$1:A1)-1,3)+1,$A$2:$A$6,$B$2:$B$6,$C$2:$C$6),INT((ROWS($A$1:A1)-1)/3)+1)
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: A Simple Formula/Helper Column To Transpose a Range

    Hi Ankur,

    It shows 0 for the blanks.

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,999

    Re: A Simple Formula/Helper Column To Transpose a Range

    Perhaps

    F2
    Formula: copy to clipboard
    IF(INDEX(CHOOSE(MOD(ROWS($A$1:A1)-1,3)+1,$A$2:$A$6,$B$2:$B$6,$C$2:$C$6),INT((ROWS($A$1:A1)-1)/3)+1)=0,INDEX(CHOOSE(MOD(ROWS($A$1:A2)-1,3)+1,$A$2:$A$6,$B$2:$B$6,$C$2:$C$6),INT((ROWS($A$1:A2)-1)/3)+1),INDEX(CHOOSE(MOD(ROWS($A$1:A1)-1,3)+1,$A$2:$A$6,$B$2:$B$6,$C$2:$C$6),INT((ROWS($A$1:A1)-1)/3)+1))

  5. #5
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: A Simple Formula/Helper Column To Transpose a Range

    hi Ankur,

    In the place of blank cell,it shows the next value.

    Also the formula has become very long

    Just for curiosity, can we do it using a couple of helper columns?


    Regards

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,999

    Re: A Simple Formula/Helper Column To Transpose a Range

    Quote Originally Posted by chullan88 View Post
    hi Ankur,

    In the place of blank cell,it shows the next value.

    Also the formula has become very long

    Just for curiosity, can we do it using a couple of helper columns?


    Regards
    Perhaps not , I did what I can..... Sorry

  7. #7
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: A Simple Formula/Helper Column To Transpose a Range

    Using array formulas and longer formula if you don't mind
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: A Simple Formula/Helper Column To Transpose a Range

    Hi,

    I managed to get it done using helper columns but still has to be refined.
    Can the experts have a look into the attached file and help me make it perfect?


    Regards
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: A Simple Formula/Helper Column To Transpose a Range

    Quote Originally Posted by azumi View Post
    Using array formulas and longer formula if you don't mind
    Hi azumi,

    Thanks for your effort and it works perfectly!!
    But as I mentioned,I'm looking for a simpler solution.Hope you can help me modify the attached file.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Simple Formula/Helper Column To Transpose a Range

    Two questions. I need you to answer BOTH questions.

    Are the values in column C real numbers that you will add/subtract/multiply/divide later on, or are they labels?

    Can a value of zero exist anywhere in the Table?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  11. #11
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: A Simple Formula/Helper Column To Transpose a Range

    Hi Glenn,

    Ans.1) Column C is part of the range and I require these values to be part of the table.
    Ans.2) I prefer the blanks in the range to be omitted from the table.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,041

    Re: A Simple Formula/Helper Column To Transpose a Range

    Quote Originally Posted by chullan88 View Post
    Ans.1) Column C is part of the range and I require these values to be part of the table.
    I don't think your first response actually answers Glenn's question:

    Are the values in column C real numbers that you will add/subtract/multiply/divide later on, or are they labels?
    In other words, once you have transposed these values, are you then going to want to use them further in other formulae where they may be added, subtracted, etc.?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Simple Formula/Helper Column To Transpose a Range

    Unfortunately, you did not answer EITHER of my questions...

    Never mind. let's try to get the answer another way.

    to create a helper column in F2, copied down:
    =IFERROR(INDEX($A$2:$C$6,INT((ROWS($1:1)-1)/3)+1,MOD(ROWS($1:1)-1,3)+1)&"","")

    to remove blanks in G2, an array formula, copied down:
    =IFERROR(INDEX(F:F,SMALL(IF($F$2:$F$18<>"",ROW($F$2:$F$18)),ROWS($G$2:G2))),"")

    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

    Q1 (again). The numerical values from column C are now text that looks like a number. Is that a problem for you?


    Q2 is no longer important - forget it!!
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: A Simple Formula/Helper Column To Transpose a Range

    Q1 (again). The numerical values from column C are now text that looks like a number. Is that a problem for you?

    No.

    Q2 is no longer important - forget it!![/QUOTE]



    My apologies for the wrong qn interpretation.

    Thanks Glenn for the input.I'm ok with the Array Formula part but could you explain the first formula ( for the helper column).

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: A Simple Formula/Helper Column To Transpose a Range

    OK!!

    So. The formula is INDEX(Range, row number, column number)


    range is the rectangle containing your data (A2 to C6).

    To go from a 2D array to a 1D array, you need to return (going down):
    row 1, column 1 of the array
    row 1, column 2 of the array
    row 1, column 3 of the array
    row 2, column 1 of the array
    row 1, column 2 of the array
    row 1, column 3 of the array, etc


    The piece of formula in the columns bit is MOD(ROWS($1:1)-1,3)+1 So, put =MOD(ROWS($1:1)-1,3)+1 in a cell and drag it down. it returns 1,2,3,1,2,3,etc.

    The piece of formula in the rows bit is INT((ROWS($1:1)-1)/3)+1 So, put =INT((ROWS($1:1)-1)/3)+1 in a cell and drag it down. it returns 1,1,1,2,2,2,3,3,3,etc

    taken together it moves across each row and then on to the next row, etc.

  16. #16
    Forum Contributor
    Join Date
    07-12-2015
    Location
    Dubai,UAE
    MS-Off Ver
    Office 365
    Posts
    447

    Re: A Simple Formula/Helper Column To Transpose a Range

    Hi Glenn,

    Thanks for explaining in detail


    Regards

+ 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] Fill down dates overwriting times ( vba ) or by adding a helper column with formula
    By Kerryx in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-23-2016, 06:14 AM
  2. Moving average on dynamic named range without helper column
    By HemAt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-31-2016, 12:15 PM
  3. Sort by helper column even if values in helper are alike
    By NoSleepForMe in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-10-2016, 04:14 AM
  4. transpose column to a range calculate and transpose to new table loop
    By moshro1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-02-2015, 10:52 AM
  5. [SOLVED] Using array formula instead of creating a helper column
    By jasonleewkd in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-10-2014, 12:55 PM
  6. Transpose Data from a Particular Column to Multiple Column whose Range is Non-Continuous!
    By Rajeshkumar R in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2014, 05:47 AM
  7. Transpose based on helper column VBA
    By carlosriver24 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-27-2013, 03:12 AM

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