+ Reply to Thread
Results 1 to 34 of 34

Group many columns to single column and make subtraction

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Group many columns to single column and make subtraction

    Helo everyone

    I have two files in txt format A and B:

    - File A contains values one below the other (391values).

    - File B contains array values with 17 columns and each column contains 23 values (the values separated by a colon).

    I would like a batch process that allows:

    - For file B: copy the columns one below the other to form a single column

    - The output file: a txt file contains the subtraction result between the column in A file and the resulting column in B file.


    This operation will be repeated for several files.

  2. #2
    Forum Contributor
    Join Date
    07-01-2018
    Location
    Adelaide, South Australia
    MS-Off Ver
    Office 365, & Excel 2016 on windows 10, & 14.7 for mac, & Excel 2015 for mac
    Posts
    173

    Re: Group many columns to single column and make subtraction

    If you can supply example files, this would be a lot easier to understand

  3. #3
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    see the attachemnts in next..
    Last edited by geofad2000; 11-23-2019 at 08:36 AM.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Hi,

    after reading the top page yellow banner attach your source files and the expected result file …

  5. #5
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Group many columns to single column and make subtraction

    Hi
    try
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    see attachments
    Attached Files Attached Files
    Last edited by geofad2000; 11-23-2019 at 08:37 AM.

  7. #7
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by mohadin View Post
    Hi
    try
    Please Login or Register  to view this content.
    I have this error : Runtime error '13' type incompatibility

  8. #8
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by truk2 View Post
    If you can supply example files, this would be a lot easier to understand
    you can see the attachments file at the top.

  9. #9
    Valued Forum Contributor
    Join Date
    06-27-2010
    Location
    sYRIA
    MS-Off Ver
    Excel 2013
    Posts
    669

    Re: Group many columns to single column and make subtraction

    Try This as per your attached
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by mohadin View Post
    Try This as per your attached
    Still the same error
    Runtime error '13' type incompatibility
    in this line : x(i) = xa(i) - xb(i)

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    Try
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    It works good ..how I can make it for batch process!!!
    Last edited by geofad2000; 11-23-2019 at 11:29 AM.

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    1) Don't quote full post, unless you really need to do it. The forum doesn't like it.

    2) What do you mean by "batch process"?

  14. #14
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by jindon View Post
    1) Don't quote .....
    To modify it to repeat the action on several files: 1A, 2A, 2A ... etc 1B, 2B, 3B ... etc .... and then save the output .

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    Too vague...

    Output in a workbook or multiple workbooks?
    If one workbook, how?

    Upload 2 sets of text files and the result that you want.

  16. #16
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by jindon View Post
    Too vague...
    Output in multiple workbooks
    A1 with B1 to workbook 1
    A2 with B2 to workbook 2 ..
    ......
    etc
    for fifty pairs of files
    Attached Files Attached Files

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by jindon View Post
    ...
    Thanx, it works very well....
    just I have in A files a header of 7 lines .....and in file B a header of 6 lines, I would like the program not to read these lines.
    also if the output is a text file .. that is better.
    Last edited by geofad2000; 11-23-2019 at 01:48 PM.

  19. #19
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    Shut down my pc already.
    Will be sometime tomorrow, hopefully.

  20. #20
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    ok ..thanx again.

  21. #21
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    If further change needed, do it for yourself before you ask.
    Please Login or Register  to view this content.

  22. #22
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by jindon View Post
    .....
    Thanx jindon
    I am a beginner with the vba...does the last code exclude the seven lines of each input file (header)?

  23. #23
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    I'm only working with the files that you uploaded.

    If you can not adjust it, why didn't you upload the files that you are really working?
    Make dummy data with the correct format, so that I can write.

    It will just a wasting time for both you and I.

  24. #24
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by jindon View Post
    ...
    My objectif was to simplify the question .
    The attached files are headed, but the data to be processed starts from line number eight.
    Attached Files Attached Files

  25. #25
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    My objectif was to simplify the question .
    Then the reply will be very simplified, so you MUST adjust it for yourself.

  26. #26
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: Group many columns to single column and make subtraction

    @geofad

    Administrative Note:

    As jindon already asked you,please don't quote entire posts unnecessarily (or useless parts of a post). They clutter threads and make them hard to read.
    Use the "Quick reply" instead
    Thanks

  27. #27
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Quote Originally Posted by jindon View Post
    Then the reply will be very simplified, so you MUST adjust it for yourself.
    If I knew programming, I wouldn't ask a question here .... I'm not a specialist
    Anyway thanks

  28. #28
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,670

    Re: Group many columns to single column and make subtraction

    Remember all the member here are helping people as a volunteer, so we don't HAVE to help you, if you don't want to be clear.

    Good luck anyway.

  29. #29
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Thank you for your attempts...

  30. #30
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    According to your last attachment join at least a filled expected result workbook …

  31. #31
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    Hi Marc L
    I have fixed the problem manually I have another challenge ... you can read this question.
    https://www.excelforum.com/excel-gen...ml#post5234571

  32. #32
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: Group many columns to single column and make subtraction

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  33. #33
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    Quote Originally Posted by geofad2000 View Post
    I have fixed the problem manually
    As there is an easy way just using Excel basics like any Excel beginner can operate manually …

  34. #34
    Registered User
    Join Date
    09-04-2014
    Location
    algeria
    MS-Off Ver
    2010
    Posts
    20

    Re: Group many columns to single column and make subtraction

    I will do... thanx for response0

+ 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: 5
    Last Post: 02-06-2019, 05:59 PM
  2. How to make a single column of data into a table
    By Apcal88 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-17-2014, 06:13 PM
  3. Military date time group subtraction
    By elothian in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-08-2013, 05:59 AM
  4. [SOLVED] Single cell - double digit subtraction???
    By greenfox74 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-09-2012, 12:30 AM
  5. make single column of the sheet as readonly
    By .NetProf in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2006, 10:15 AM
  6. [SOLVED] How to chart a single column of values similar to a GROUP BY
    By Paddy in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-02-2005, 12:30 AM
  7. Replies: 1
    Last Post: 06-02-2005, 06:05 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