+ Reply to Thread
Results 1 to 4 of 4

Look for duplicated & unique values in adjacent column. Perform math on result. . .

  1. #1
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Look for duplicated & unique values in adjacent column. Perform math on result. . .

    Col A has wire part numbers. Many are duplicated.
    Col H has wire lengths for those part numbers. Some lengths may be duplicates for the wire part number. (by design)

    In another column, I'm using SUMIF to calculate the total wire length used for each wire type.

    The problem: Need to look at the col A part number, and if a length for that part number is duplicated or just has a single instance, I need to multiply a single instance of that piece of wire by 2.

    Example:

    (source data)
    Wire 1 length 12
    Wire 1 length 12
    Wire 1 length 15
    Wire 2 length 6
    Wire 3 length 55
    Wire 3 length 20

    Result:
    SUMIF column: (SUMIF(A:A,wire_fromA,H:H))

    Wire 1 Length 39
    Wire 2 length 6
    Wire 3 length 75

    Setup Column (the problem column) (sum of unique lengths for that part number multiplied by 2.)
    Wire 1 length 54
    Wire 2 length 12
    Wire 3 length 150


    Thanks for any help obtaining a setup value. Plenty of room for helper columns. I tried creating unique values by combining col A and col H, counting the instances. . . but don't exactly know if that might contribute to a correct approach.

    Peter

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Look for duplicated & unique values in adjacent column. Perform math on result. . .

    Tony Valko's unique sumif array can do it for you:

    =SUM(2*IF(FREQUENCY(IF(A$2:A$7=E2,MATCH(B$2:B$7,B$2:B$7,0)),ROW(B$2:B$7)-ROW(B$2)+1),B$2:B$7))

    This is an array formula, confirmed with Ctrl+Shift+Enter when exiting the cell

    This formula assumes A2:A7 are wire types, B2:B7 are lengths, and E2 is Wire1.

    sum of unique values x 2.xlsx
    Last edited by daffodil11; 10-25-2013 at 11:26 AM. Reason: Credit

  3. #3
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Look for duplicated & unique values in adjacent column. Perform math on result. . .

    Awesome!!!!!

    Thank you dafodil11 and of course to Mr. Tony Valko.

    Peter

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Look for duplicated & unique values in adjacent column. Perform math on result. . .

    Glad I could help out.


    Feel free to mark the thread as Solved under the Thread Options at the top of the page so others can search for this solution as well.

+ 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] Count Unique Values in a Column that are not in adjacent Column
    By sskgintl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-15-2013, 03:18 PM
  2. Pull unique values based on adjacent column
    By freud1 in forum Excel General
    Replies: 9
    Last Post: 07-02-2012, 11:36 AM
  3. Replies: 3
    Last Post: 03-17-2012, 11:32 PM
  4. Perform simple math operations on filtered column?
    By dougw03 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2011, 06:22 PM
  5. capture unique values from 1 column and populate the result into another column
    By teachMeExcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2009, 05:21 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