+ Reply to Thread
Results 1 to 8 of 8

formula or code for unique values

  1. #1
    Forum Contributor
    Join Date
    09-30-2015
    Location
    LA my baby
    MS-Off Ver
    2013
    Posts
    727

    formula or code for unique values

    Hello. I have a list of customer ID's in column 1 and then 3 columns of values for each ID. Can I write code that only includes the first instance of each customer ID? So, you'd be adding three columns with values and blank rows for duplicates. Code or formulas are fine. Thanks!!

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: formula or code for unique values

    assuming columns A-D
    in B2 use the formula
    =IF($A2 = $A1,"",B2)

    copy that across the 3 columns and then drag it all down.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Contributor
    Join Date
    09-30-2015
    Location
    LA my baby
    MS-Off Ver
    2013
    Posts
    727

    Re: formula or code for unique values

    I don't think that works. Spreadsheet example attached. Thanks.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: formula or code for unique values

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-30-2015
    Location
    LA my baby
    MS-Off Ver
    2013
    Posts
    727

    Re: formula or code for unique values

    @pjwhitfield. I think that works actually, if you sort so that values are grouped together.

  6. #6
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: formula or code for unique values

    Quote Originally Posted by stephme55 View Post
    @pjwhitfield. I think that works actually, if you sort so that values are grouped together.
    Apologies yes, I forgot to mention that fact!

  7. #7
    Forum Contributor
    Join Date
    09-30-2015
    Location
    LA my baby
    MS-Off Ver
    2013
    Posts
    727

    Re: formula or code for unique values

    @John. Thanks for your code. I didn't quite understand what it was doing though. I ran it on my spreadsheet and it deleted all values except for 1 in column A. Can you walk me through what each snippet is doing? Thanks.

  8. #8
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: formula or code for unique values

    Stephme55,

    If you just want a formula that isn't reliant on your data being sorted try this.
    Please Login or Register  to view this content.
    Happy with my advice? Click on the * reputation button below

+ 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. Code selects first and last rows with consecutive values and with unique values
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2015, 08:38 PM
  2. Code to Validate for Unique Values
    By rmc71291 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-13-2015, 12:38 PM
  3. [SOLVED] Formula or VBA - Comparison CSV Values between 3 cells for used range. Find unique values.
    By grphillips in forum Excel Programming / VBA / Macros
    Replies: 36
    Last Post: 06-09-2014, 02:12 PM
  4. [SOLVED] Excel VBA Code Instead of SumIf Array Formula for Unique Values
    By excelforumkeys in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-12-2014, 03:39 PM
  5. How to adapt this code to copy unique values in cells
    By RayJay01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2014, 07:18 AM
  6. Replies: 8
    Last Post: 12-30-2008, 12:06 PM
  7. Sorting unique values and returning values from a formula
    By MarcusA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-01-2006, 01:40 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