+ Reply to Thread
Results 1 to 6 of 6

Extract Unique Data and Assign a Code

  1. #1
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Extract Unique Data and Assign a Code

    Hello,

    Please see attached
    I need to extract unique data from Column B to Column J (sorted by Code) and Assign a Code to Column K
    Code is driven by LEADINGS Spaces in B
    I need unique data from B, trimmed, with larger Codes

    Thanks all
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Extract Unique Data and Assign a Code

    Hi ionelz,

    If you use the blank column C and make it Col B trimmed then a Pivot Table will do what you want, if you sort by the code. See the attached.
    Trimmed Pivot Sort by Count.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Extract Unique Data and Assign a Code

    Quote Originally Posted by MarvinP View Post
    Hi ionelz,

    If you use the blank column C and make it Col B trimmed then a Pivot Table will do what you want, if you sort by the code. See the attached.
    Attachment 718777
    I would preferred a Formula, and Code is manual typed by me, I need a formula for code too, thanks for looking
    All I know is B

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Extract Unique Data and Assign a Code

    Hi ionelz,

    If you had the newer Excel 365 you could use the Unique() and Sort() functions. You show an older Excel 2016 so I don't think they are available to you.
    See this site to see if it gets you closer to your answer.
    https://www.thespreadsheetguru.com/b...20end%20result.

  5. #5
    Forum Contributor
    Join Date
    05-20-2016
    Location
    Detroit
    MS-Off Ver
    Office 365 Version 2008 (July 2020)
    Posts
    819

    Re: Extract Unique Data and Assign a Code

    Yes, I hope to get new Excel soon...
    Until then need long formula for extract and sort
    Here, I need to determine Code Formula in F based on numbers in E
    Then to extract unique, excluding lower code

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,670

    Re: Extract Unique Data and Assign a Code

    This proposal employs a helper column (G) which may be moved and/or hidden for aesthetic purposes.
    The Code column (F) is populated using**: =SUM(IF(E3>$E$3:$E$13,1/COUNTIF($E$3:$E$13,$E$3:$E$13)))
    **Denotes an array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    The helper column is populated using: =IF(F3=AGGREGATE(14,6,F$3:F$13/(TRIM(B$3:B$13)=TRIM(B3)),1),F3,"")
    The Trimmed Data column (J) is populated using: =IF(K3="","",TRIM(INDEX(B$3:B$13,AGGREGATE(15,6,(ROW(B$3:B$13)-ROW(B$2))/(G$3:G$13=K3),COUNTIFS(K$3:K3,K3)))))
    The Code column (K) is populated using: =IFERROR(SMALL(G$3:G$13,ROWS(A$1:A1)),"")
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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: 3
    Last Post: 10-15-2020, 11:33 PM
  2. Extract unique product code
    By shtmd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-26-2019, 08:06 AM
  3. Assign Data Evenly Based on Unique Identifier
    By mattyp in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-20-2016, 01:02 PM
  4. Macro VBA Code - Extract using unique identifiers
    By JMcelhone in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-29-2015, 10:51 AM
  5. [SOLVED] How to assign data with unique IDs?
    By missy22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2014, 11:20 AM
  6. Sum all amounts, for same code, for same unique id - Extract to just 1 line
    By tyrese214 in forum Access Tables & Databases
    Replies: 4
    Last Post: 07-11-2010, 02:26 AM

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