+ Reply to Thread
Results 1 to 10 of 10

Unique Identifier for Certain Criteria

  1. #1
    Registered User
    Join Date
    04-21-2017
    Location
    United States
    MS-Off Ver
    Excel
    Posts
    35

    Unique Identifier for Certain Criteria

    I posted a similar question earlier, but this question has slightly different criteria.

    I'm looking for this column to either have the number 1 or 2... a number will only appear if the column says "YES" for include2 column... if a team has a yes in Include1 and Include2, then I want the first team that shows up with the same TransID to have a 1 and the other team to have a 2....

    If a team has a no in the include1 column, but a yes in the include2 column, then they should have a 2.... if the other team in this trans has two yes in Include1 and Include 2, regardless of whether they are the first team or not, then they will have a 1

    The desired result is below and attached. Thank you so much!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Unique Identifier for Certain Criteria

    Not quite clear.

    This

    "If a team has a yes in Include1 and Include2, then I want ... ...and the other team to have a 2...."

    contradicts this

    "if the other team in this trans has two yes in Include1 and Include 2, regardless of whether they are the first team or not, then they will have a 1"
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    04-21-2017
    Location
    United States
    MS-Off Ver
    Excel
    Posts
    35

    Re: Unique Identifier for Certain Criteria

    The attached document has the desired result if that helps...

    Let me see if I can give 2 situations to help paint the picture:

    Situation 1: Same transaction #... both teams in the transaction have a "YES" in the "Include1" and the "Include2" columns... the first team listed as the YES/YES team would be team 1 and the other would be team 2

    Situation 2: Same transactions #.... The first team listed has a "NO" in the "Include1" and a "YES" in the "Include2" column... I want them listed as team 2.... the 2nd team listed would have a "YES" in the "Include1" column and a "YES" in the "Include2" column


    Both of these situations should be represented in the document attached

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Unique Identifier for Certain Criteria

    I'm finding this very difficult, I'll have a go at solving it but I'm running out of ideas..

  5. #5
    Registered User
    Join Date
    04-21-2017
    Location
    United States
    MS-Off Ver
    Excel
    Posts
    35

    Re: Unique Identifier for Certain Criteria

    Difficult as far as my explanation or just the general difficulty of the formula?

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Unique Identifier for Certain Criteria

    Formula, I can't even get the first situation set up.

  7. #7
    Registered User
    Join Date
    04-21-2017
    Location
    United States
    MS-Off Ver
    Excel
    Posts
    35

    Re: Unique Identifier for Certain Criteria

    Maybe we can tag team it...

    I think this figures out the first portion, but I can't get the second one

    =IF($H3="NO","-",IF(AND($H3="YES",$E3=INDEX($E$3:$E$17,MATCH($D3,$D$3:$D$17,0))),1,2))

  8. #8
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Unique Identifier for Certain Criteria

    Hi, to all!

    Maybe this could be a try:
    =IF(H3="NO","-",IF(COUNTIFS(D$3:D$17,D3,G$3:G$17,"YES")=1,1+(G3="NO"),IF(D2=D3,IF(COUNTIF(E$2:E2,E3),INDEX(B$2:B2,MATCH(E3,E$2:E2,)),N(B2)+1),1)))

    If not, put a "representative" file showing us the correct answer. Blessings!
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-21-2017
    Location
    United States
    MS-Off Ver
    Excel
    Posts
    35

    Re: Unique Identifier for Certain Criteria

    I have attached a new file that is more "representative." That formula is correct for some of my columns, but as you can see from the
    "Desired ID" column, some are not showing up with an ID at all (which is confusing me because it is pulling a "-" from the first
    IF statement even though the "Include2" column says "YES"). Please let me know what I can do to fix this!
    Attached Files Attached Files

  10. #10
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Unique Identifier for Certain Criteria

    Hi, again!

    Check this revised formula:

    [B3] : =IF(H3="NO","-",
    IF(COUNTIFS(D$3:D$1000,D3,G$3:G$1000,"YES")=1,1+(G3="NO"),
    IF(D2=D3,IF(COUNTIFS(D$2:D2,D3,E$2:E2,E3),LOOKUP(2,1/(D$2:D2=D3)/(E$2:E2=E3),B$2:B2),N(B2)+1),1)))


    Blessings!

+ 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. Unique Identifier for Certain Criteria - PART 2
    By rosetc16 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-09-2019, 05:47 PM
  2. Want to use multiple criteria using one unique identifier
    By Foneraider in forum Excel General
    Replies: 2
    Last Post: 07-16-2017, 07:12 AM
  3. Replies: 1
    Last Post: 02-16-2017, 07:53 PM
  4. Replies: 1
    Last Post: 01-29-2015, 04:08 PM
  5. Unique Identifier
    By mussonip in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-07-2014, 10:46 AM
  6. [SOLVED] Two Criteria Lookup, with two seporate criteria making a unique identifier.
    By Trevasaurus in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-26-2013, 11:00 AM
  7. Unique identifier
    By Steve Barnett in forum Excel General
    Replies: 19
    Last Post: 01-06-2006, 07:30 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