+ Reply to Thread
Results 1 to 6 of 6

Data segmenting according to specific total of a column

  1. #1
    Forum Contributor
    Join Date
    04-04-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    197

    Data segmenting according to specific total of a column

    I have a worksheet with two columns: ColA with over 320,000 rows of data of file sizes in bytes, and ColB which contains the equivelant value of ColA in megabytes.

    I am in need to divide ColA data into segements separated with one empty row. Dividing should occure when the total value of ColB reaches around 900 megabyte more or less.

    In addition, each segment's total of megabytes besides the total number of rows for that segment should be placed in the last row of that segment in ColC and ColD.

    I am attaching part of my real data in both columns A & B in Sheet1. I have also manually caculated and segmented the first two groups of ColA in Sheet2 as an example of the final product.

    Can I get some expert assistance with this request please?

    Many thanks in advance.

    T.
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: 2019 but still use also older versions
    Posts
    6,766

    Re: Data segmenting according to specific total of a column

    Such macro (for large files may not be quick - if you have many of them and need quicker processing - let us know) shall do the work:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    04-04-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    197

    Re: Data segmenting according to specific total of a column

    More than excellent Kaper .. really fantastic .. the desired result is achieved through your genius code which ran smoothly and fast despite the large number of rows.
    Thank you very much for such great work.
    Please accept my deep respect and gratitude.

    T.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    XLS 2016
    Posts
    4,003

    Re: Data segmenting according to specific total of a column

    Another way to do, should be faster ...!
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  5. #5
    Forum Contributor
    Join Date
    04-04-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    197

    Re: Data segmenting according to specific total of a column

    Thank you very much PCI, you have always been of a great assistance to me in many issues, and here, again, you're proving that. Sure your code does the job as exactly as desired, which is enriching this question with such amazing code. I hope this question will be of great benefit to the general who have a similar issue.

    Merci beaucoup, je suis très reconnaissant.

    T.

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    XLS 2016
    Posts
    4,003

    Re: Data segmenting according to specific total of a column

    Content d'avoir aider, à une prochaine fois.
    Please to help, see for next time

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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