+ Reply to Thread
Results 1 to 3 of 3

Loop to scan data and aggregate Rows that are the same

  1. #1
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Loop to scan data and aggregate Rows that are the same

    Hi guys,


    What I am trying to do is get excel to aggregate lines where the information is part of the same transaction [more info coming]. Right now it appears broken up in pieces, so there are may be 3 or 4 or more rows for a particular transaction, each with different "Profit" in column O and "Amount" in column D and the rest of the columns data being the same.

    Ex:
    Account “a12” bought “Harry Potter and the Philosophers Stone” 4 times each different "Profit" in column O and in different "Amounts" in column C. However info from A:C, E:N is identical signaling it is the same transaction.

    Goal
    I want excel to Loop through my spreadsheet and if it finds rows where a transaction is split, aggregate the data summing Column D and O, the other columns will simply be a simple copy paste as they all use the same data, the end result would be 1 line of data aggregating it

    I really appreciate your time looking at this, please help me... have a good day!
    Last edited by lougs7; 09-21-2018 at 09:35 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Loop to scan data and aggregate Rows that are the same

    Surely a Pivot Table is the Optimum and more elegant solution - see attached.
    Never resort to VBA when there are perfectly straightforward Excel Functions or functionality.

    I'm assuming the account A12 10 times was a typo. There are only 4 lines
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    09-23-2015
    Location
    Toronto, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: Loop to scan data and aggregate Rows that are the same

    Quote Originally Posted by Richard Buttrey View Post
    Surely a Pivot Table is the Optimum and more elegant solution - see attached.
    Never resort to VBA when there are perfectly straightforward Excel Functions or functionality.

    I'm assuming the account A12 10 times was a typo. There are only 4 lines
    Thank you Richard, I am going to try and play around with this in Pivot table as you say. I do have a macro that extracts data and inputs it in sheet1, it may add +1000 rows per extract. I was hoping to aggregate it in that sheet because I have another macro that works off that data in that form on sheet one, it would make it easier if I can get it aggregated there, In any event you know something about how I can do that please let me know

+ 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] Aggregate results from multiple rows
    By Kyba in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-26-2017, 08:52 AM
  2. RFID Time and date stamp on scan and off scan
    By forey89 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2015, 06:46 AM
  3. Aggregate function to number rows
    By cdumper in forum Excel General
    Replies: 9
    Last Post: 09-27-2014, 07:22 PM
  4. Scan-in, Scan-out tool inventory with barcode scanner
    By rycr023 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2014, 11:52 AM
  5. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  6. Loop Lookup Aggregate Total
    By fayzter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2009, 01:19 PM
  7. HOW CAN I SCAN DATA WITH COLUMNS AND ROWS DIRECTLY INTO SPREADSHE.
    By SUFI DARWAISH in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 04-20-2005, 01: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