+ Reply to Thread
Results 1 to 21 of 21

Copy each row consecutively into one single column preserving formulas

  1. #1
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Copy each row consecutively into one single column preserving formulas

    Hi

    Racking my brains and getting nowhere fast...

    I have tried adapting various formulas from web pages and none of the seem to do what
    I need as they seem to only work on a set defined range...
    #
    Is it possible to have a formula that you enter into column I and it copies all data from each
    row in columns A to G?

    Each cell in Columns A to G have a formula in them that is getting data from other worksheets
    and its important that the formulas are preserved as the data that they retrieve will change and
    this should be reflected in Column I also.

    I don't wish to ask for too much but also could the formula also return nothing if a cell in a Row
    is blank?

    I have attached a example of what I need but if you need any more information please ask

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Copy each row consecutively into one single column preserving formulas

    In I3, try:

    =IFERROR(INDIRECT(TEXT(AGGREGATE(15,6,(ROW(A$3:G$6)*10^5+COLUMN(A$3:G$6))/(A$3:G$6<>0),ROWS(I$3:I3)),"R0000C00000"),0),"")

    and copy down. It also excludes empty values, otherwise delete the blue highlighted part.

    Best,
    berlan

  3. #3
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Hi Berlan

    Wow, than you for the fast reply, really appreciate it.

    Tried your formula and it returns empty cells, eg. No date from the rows.?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Copy each row consecutively into one single column preserving formulas

    Hi, welcome to the forum

    Is it possible to have a formula that you enter into column I and it copies all data from each row in columns A to G?
    Short answer - no. Formulas work with what is displayed in a cell, not the actual cell contents.
    As a test, put =LEFT("KennyUK",5) in A1...the cell will display Kenny
    Then In B1 put =LEFT(A1,3)
    You will only get Ken not LEF or =LE

    You might be able to do what you want using built-in TRANSPOSE option, but this will just take all the data in columnm I and put it in a row

    What exactly are those formulas doing/what do they look like? Perhaps they can be recreated in your "final" table?

    Other than that, I think the only option here would be VBA

    edit: Berlan, nice formula, but it will only return what teh answers to those formulas are, not the formulas themselves
    Last edited by FDibbins; 08-09-2015 at 07:46 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Copy each row consecutively into one single column preserving formulas

    Not exactly sure if I've understood correctly.

    If you want the exact formulas, if any in there, you could get those by (in I3 and copy down):

    =IFERROR(FORMULATEXT(INDIRECT(TEXT(AGGREGATE(15,6,(ROW(A$3:G$6)*10^5+COLUMN(A$3:G$6)),ROWS(I$3:I3)),"R0000C00000"),0)),"")

    will be seen as text strings, which can then be converted to values and made to formulas.

    Try it out making some of the values in A3:G6 to formulas (e.g. =A1, =IF( ... ) and see how it works.

    Hope that helps.

    Cheers

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Copy each row consecutively into one single column preserving formulas

    If you're using Excel 2007 it doesn't support the AGGREGATE function.

    This would generate a #NAME? error which would be trapped by the IFERROR function and return a blank.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Copy each row consecutively into one single column preserving formulas

    @Tony Valko, very true, missed that.

    With that in mind, we need to use an array formula (confirm by Ctrl+Shift+Enter) in I3 and drag down.

    =IFERROR(INDIRECT(TEXT(SMALL(ROW(A$3:G$6)*10^5+COLUMN(A$3:G$6),ROWS(I$3:I3)),"R00000C00000"),0),"")

    for the output values in those cells only, incl empty cells.

    and for formulatext,

    =IFERROR(FORMULATEXT(INDIRECT(TEXT(SMALL(ROW(A$3:G$6)*10^5+COLUMN(A$3:G$6),ROWS(I$3:I3)),"R00000C00000"),0)),"")

  8. #8
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Okay, how about just showing the results of the formulas in the rows in the columns?

    Sort of a transpose type function but one that can cope with a variable number of rows?

  9. #9
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Hang on, I think this has done it

    =IFERROR(INDIRECT(TEXT(SMALL(ROW(A$3:G$6)*10^5+COLUMN(A$3:G$6),ROWS(I$3:I3)),"R00000C00000"),0),"")

    Testing it now

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Copy each row consecutively into one single column preserving formulas

    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

  11. #11
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Thanks for the kind suggestions so far everyone, really appreciate it.


    Well it kind of works but it only copies the first four rows into the column...

    If its possible I need a formula that can copy a infinite or unknown number of rows,
    or putting it another way, copy how ever many rows are entered?

  12. #12
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Quote Originally Posted by FDibbins View Post
    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    Hi FDibbins

    I did just that in my original post

  13. #13
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Okay, I think I've solved it

    I changed the range reference (in Red)

    =IFERROR(INDIRECT(TEXT(SMALL(ROW(A$3:G$6)*10^5+COLUMN(A$3:G$6),ROWS(I$3:I3)),"R00000C00000"),0),"")

    To 4000 which I believe will be more than enough (in Blue)

    =IFERROR(INDIRECT(TEXT(SMALL(ROW(A$3:G$4000)*10^5+COLUMN(A$3:G$4000),ROWS(I$3:I3)),"R00000C00000"),0),"")

    Seems to have done the trick

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Copy each row consecutively into one single column preserving formulas

    Try this...

    Entered in I3 and copied down:

    =OFFSET(A$3,INT((ROWS(I$3:I3)-1)/7),MOD(ROWS(I$3:I3)-1,7))

    7 refers to the number of columns in the range A3:G6.

  15. #15
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Copy each row consecutively into one single column preserving formulas

    Yes, I saw that 1, I meant a file that showed some of your formulas.

    perhaps the best way to do this, is not to copy your formulas - or their answers - across from column I to columns A:G, but instead, maybe recreate the formulas in A:G

  16. #16
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Now this is interesting...

    Both Berlan's and Tony Valko's formulas work perfectly - Thank you both, really good of you all to help.

    Is there any benifit from using one formula instead of the other or are both just different ways of doing the same thing ?

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Copy each row consecutively into one single column preserving formulas

    Well, I'm naturally biased towards my suggestions...

    My suggestion uses less functions and is not as complicated!

  18. #18
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Quote Originally Posted by Tony Valko View Post
    Well, I'm naturally biased towards my suggestions...

    My suggestion uses less functions and is not as complicated!
    Just been testing with both formulas using 800 Rows of dummy formulas and yours seems to calculate a little faster so I'm going to go with yours for now.

    Thanks again Tony

  19. #19
    Registered User
    Join Date
    08-09-2015
    Location
    East Midlands
    MS-Off Ver
    2007
    Posts
    10

    Re: Copy each row consecutively into one single column preserving formulas

    Just wanted to say thank you to everyone for your help.

    Thanks guys

  20. #20
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Copy each row consecutively into one single column preserving formulas

    You're welcome. We appreciate the feedback!

  21. #21
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,050

    Re: Copy each row consecutively into one single column preserving formulas

    I understand that you have been given some options to pull the values from your list if formulas, into a table, but have you considered my suggestion of not even having the column of formulas, and putting them directly into a table?

+ 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. Replies: 14
    Last Post: 05-10-2013, 03:27 PM
  2. [SOLVED] Dragging formulas and preserving the same range.
    By ricky2k2 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-05-2012, 09:17 AM
  3. [SOLVED] Multiple formulas in column with reference to single cell - Copy Issue
    By MarVil85 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 06-21-2012, 02:44 PM
  4. copy a single column from mutiple workbooks into a single workbook
    By Savan87 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2011, 11:27 AM
  5. Insert new row preserving row formulas and format
    By d_rock90 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2008, 02:17 PM
  6. Copy & send single sheet with values and no formulas
    By Sven in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-26-2008, 04:56 PM
  7. Preserving Formulas after Column Insert
    By rmeader in forum Excel General
    Replies: 2
    Last Post: 10-05-2006, 04:16 PM
  8. Preserving Formulas
    By drwexcel in forum Excel General
    Replies: 0
    Last Post: 06-01-2005, 12:23 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