+ Reply to Thread
Results 1 to 4 of 4

Data Consolidation

  1. #1
    Registered User
    Join Date
    03-17-2008
    Posts
    16

    Data Consolidation

    Hello,

    I am working with some spreadsheets that contain redundant information when I get them and I would like to find a way to make my life easier by finding a way to consolidate the data.

    I have a UPC column - this is the column that contains redundancies. Looking at the attached example, I would like to combine the UPC and amount columns (without changing their values) and sum the quantities and totals columns.

    I am not sure if there is a way to do this using the consolidate tool.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    In J7 and copy right and down,

    =SUMIF($B$7:$B$32, $H7, D$7:D$32)

    In I7 and copy down,

    =K7 / J7

  3. #3
    Registered User
    Join Date
    03-17-2008
    Posts
    16
    shg,



    These two formulas work great for the quantity and total columns. However, the SUMIF formula uses criteria that wouldn't exist on my spreadsheet unless I went through and manually found every different UPC - of which there could be upwards of 100. The UPC and amount columns would need to be generated from the before section before I could use the SUMIF formula you provided. So basically everything that is under the "After" column would be generated from the "before" data.

    One part of this sheet that takes the most time is manually putting together a new UPC and amount column. Could it be possible to have a macro go through the UPC column and when ever it finds a new UPC copy and paste it and its amount to a new column?

    Thanks!

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    For a UI approach, you could use Advanced Filter to create a unique list of UPCs. Our you could use a couple of helper columns:

    Please Login or Register  to view this content.
    The formula in B2 and down is =IF(COUNTIF(A$2:A2, A2)=1, A2, "")

    And C2 and down is =IFERROR(SMALL(B2:B38, ROW() - 1), "")

    For a VBA approach, you could use a Dictionary object, for which you can find many examples here in the forum.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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