+ Reply to Thread
Results 1 to 5 of 5

Easer way?: Select 1st on 1 occurrence, Select 2nd on 2occurrences; Select 3rd on 3 occ.

Hybrid View

  1. #1
    Registered User
    Join Date
    03-11-2019
    Location
    Slovenija
    MS-Off Ver
    365
    Posts
    13

    Easer way?: Select 1st on 1 occurrence, Select 2nd on 2occurrences; Select 3rd on 3 occ.

    Need to select Select 1st occurrence if no duplicates , Select 2nd occurrence if 2duplicates ; Select 3rd occurrence if 3 duplicates ....

    SOLVED with additional columns:
    - first column =COUNTIF(A:A;A2) counts number of occurrences
    - second column: =COUNTIF($A$2:$A2; $A2) identify 1st, 2nd, 3rd,
    - third column: IF numbers in previous two columns the same pick that one, else don't pick

    OR

    To use single column only : =IF(COUNTIF(A:A;A2)=COUNTIF($A$2:$A2; $A2);" pick";"dont pick")

    Ideas for faster and easier solution although this one is pretty simple already?

    Screen 1632 (Mobile).jpg

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,413

    Re: Easer way?: Select 1st on 1 occurrence, Select 2nd on 2occurrences; Select 3rd on 3 o

    Which version of Excel? Please update your profile to show ONLY the version you are using and need help with.

    There are instructions at the top of the page explaining how to attach your sample workbook. Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,162

    Re: Easer way?: Select 1st on 1 occurrence, Select 2nd on 2occurrences; Select 3rd on 3 o

    Another way is
    Formula: copy to clipboard
    =IF(ROW()=XMATCH(A2,$A$1:$A$100,0,-1),"Pick","Don’t Pick")

  4. #4
    Registered User
    Join Date
    03-11-2019
    Location
    Slovenija
    MS-Off Ver
    365
    Posts
    13

    Re: Easer way?: Select 1st on 1 occurrence, Select 2nd on 2occurrences; Select 3rd on 3 o

    TNX Fluff13. I love this solution too, as it presents school example of XMatch searching from last. upwards.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,162

    Re: Easer way?: Select 1st on 1 occurrence, Select 2nd on 2occurrences; Select 3rd on 3 o

    Glad to help & thanks for the feedback.

+ 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] ADODB select statement syntax - select records before first day of current month
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2021, 07:09 AM
  2. Replies: 11
    Last Post: 04-19-2021, 07:46 PM
  3. Select dates when first and last occurrence of a value below date row occurs
    By Mickeyflip in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-07-2020, 02:46 PM
  4. [SOLVED] Select routing based on characteristics of parts and select the correct machines
    By GordonKy42 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-23-2019, 06:04 AM
  5. Replies: 11
    Last Post: 11-03-2017, 05:11 AM
  6. Replies: 1
    Last Post: 08-18-2016, 03:17 AM
  7. Newbie: Auto Select/un-Select an Range of Slicer Items
    By luckyali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 09:52 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