+ Reply to Thread
Results 1 to 29 of 29

Not sure what I'm doing wrong here...

  1. #1
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Not sure what I'm doing wrong here...

    I'm slightly modifying a another function I found online for a table of values. It's purpose is to detect duplicate pairing of the same name from a roster of about 20 persons. The desired result would be 20 unique pairs.

    Original Function =IF(A1=F1, "DUPLICATE!", "GOOD!") This checks if a person is paired up with themselves. For example, if Wolverine=Wolverine, then "DUPLICATE!" is indicated in a separate column.
    The value for cell A1 is a fixed number, and the value for cell F1 is a randomly generated number using the RANK function that references a RANDBETWEEN function in a separate column.
    The fixed number from A1 is associated with a person's name in B1, and the random number from F1 is associated with another person's name in C1 which has a VLOOKUP function.

    This works perfectly.

    However, I'm trying to modify the function by also checking if a pair of two different people shows up again together in a different table. For example, if Wolverine and Jean were paired up in one table, I don't want them to be paired up in a separate table.

    I tried this, =IF(A1=F1, "DUPLICATE!",IF(B1:C1=B29:C29,"DUPLICATE!","GOOD!"))

    For some reason the parentheses for the second if function are red, and when it runs the entire function I keep getting a "#VALUE" within a cell of the "Duplicate Detector" column.

    I can't find the website I got the instructions from. I'll try to find it for further clarification.
    Last edited by machinegod; 10-22-2019 at 01:26 PM.

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

    Re: Not sure what I'm doing wrong here...

    How about
    =IF(A1=F1, "DUPLICATE!",IF(B1&"|"&C1=B29&"|"&C29,"DUPLICATE!","GOOD!"))

  3. #3
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    OMG! That worked! Thank you!

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

    Re: Not sure what I'm doing wrong here...

    You're welcome & thanks for the feedback

  5. #5
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by Fluff13 View Post
    You're welcome & thanks for the feedback
    You're welcome!

    Another thing...

    Is there a way to avoid writing the formula over and over again to reference each pairing?Screenshot of Worksheet.jpg
    Last edited by machinegod; 10-22-2019 at 02:35 PM.

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

    Re: Not sure what I'm doing wrong here...

    Very probably, but can you please supply a sample workbook, I can hardly read the image.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  7. #7
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    Okay. I attached the sample.

    All the names in the worksheet are either Marvel or DC character names.
    Attached Files Attached Files

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Not sure what I'm doing wrong here...

    You can use this in D29:

    =IF(OR(B29=C29,COUNTIFS(StudentTable2[Reviewer],B29,StudentTable2[Reviewee],C29)),"DUPLICATE!","GOOD!")

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

    Re: Not sure what I'm doing wrong here...

    How about in D3
    =IF(OR(B3=C3,COUNTIFS(B:B,B3,C:C,C3)>1),"Duplicate","Good")

    then copy paste the formula into the 1st row in each table

  10. #10
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by Fluff13 View Post
    How about in D3
    =IF(OR(B3=C3,COUNTIFS(B:B,B3,C:C,C3)>1),"Duplicate","Good")

    then copy paste the formula into the 1st row in each table
    Didn't work. Now it indicates pairing of the same name as "Good", instead of duplicate.

  11. #11
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by 63falcondude View Post
    You can use this in D29:

    =IF(OR(B29=C29,COUNTIFS(StudentTable2[Reviewer],B29,StudentTable2[Reviewee],C29)),"DUPLICATE!","GOOD!")
    This doesn't run through the entire sheet, but I may be able to modify the formula. Thank you.

  12. #12
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by machinegod View Post
    Didn't work. Now it indicates pairing of the same name as "Good", instead of duplicate.
    I think I fixed it with this...
    =IF(OR(B3=C3,COUNTIFS(B:B,B3,C:C,C3)>1),"Duplicate!",IF(B29=C29,"Duplicate!","Good!"))

    I'll see if it works out.
    Last edited by machinegod; 10-23-2019 at 11:34 AM.

  13. #13
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Not sure what I'm doing wrong here...

    Administrative Note:

    Please update your user profile MS Office verion - please be explicit, as there are various 'current' versions that are subtly different (e.g. Office 2019 standalone and Office 365 subscription). Your helpers will benefit from knowing exactly which you are using.
    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.

  14. #14
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by machinegod View Post
    This doesn't run through the entire sheet, but I may be able to modify the formula. Thank you.
    Thanks for the rep!

    The formula that I offered gave you the same exact result as the one that you already had in there.
    I thought that's what you were after.

  15. #15
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Not sure what I'm doing wrong here...

    Thank you for updating your profile. However, you appear to have given me negative rep for asking you to do so. Might I know why you felt this deserved a 'slap'? Or have you clicked the wrong button and meant to say 'thanks'?

  16. #16
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    For some reason when I use this formula, it labels a pair as a duplicate even though it isn't.

    =IF(OR(B3=C3,COUNTIFS(B:B,B3,C:C,C3)>1),"Duplicate!",IF(B29=C29,"Duplicate!","Good!"))

    Then when I try adding more criteria like the function below for the third table, it returns a "#VALUE" within every row of the third table.

    =IF(OR(B29=C29,COUNTIFS(StudentTable2[Reviewer],B45,StudentTable2[Reviewee],C45,LabATable[Reviewer (2nd Set)],B45,LabATable[Reviewee (2nd Set)],C45)),"DUPLICATE!","GOOD!")

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Not sure what I'm doing wrong here...

    Since the thread is getting a bit long.... can we see a fresah attachment showing the latest position... and your latest requirement?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  18. #18
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by 63falcondude View Post
    Thanks for the rep!

    The formula that I offered gave you the same exact result as the one that you already had in there.
    I thought that's what you were after.
    I had noted within the sheet provided that I wanted all the tables to be checked for duplicates.

  19. #19
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by Glenn Kennedy View Post
    Since the thread is getting a bit long.... can we see a fresah attachment showing the latest position... and your latest requirement?
    Okay. Give me some time to upload the two different versions (with the separate formulas from Fluffly and Falcon) that I'm trying to figure out.

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

    Re: Not sure what I'm doing wrong here...

    Using this formula
    =IF(OR(B3=C3,COUNTIFS(B:B,B3,C:C,C3)>1),"Duplicate","Good")
    It indicates all dupes regardless of table.
    Attached Files Attached Files

  21. #21
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Not sure what I'm doing wrong here...

    ... unless of course Fluff 13 has just nailed it...

  22. #22
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Post Re: Not sure what I'm doing wrong here...

    Here they are.

    Thanks for the help, everyone.
    Attached Files Attached Files

  23. #23
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    "Using this formula
    =IF(OR(B3=C3,COUNTIFS(B:B,B3,C:C,C3)>1),"Duplicate","Good")
    It indicates all dupes regardless of table."

    Thanks. I'll check it out.

  24. #24
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Not sure what I'm doing wrong here...

    I'll sit on my hands for now...

  25. #25
    Registered User
    Join Date
    10-22-2019
    Location
    California, US
    MS-Off Ver
    2016 (64-bit)
    Posts
    70

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by Fluff13 View Post
    Using this formula
    =IF(OR(B3=C3,COUNTIFS(B:B,B3,C:C,C3)>1),"Duplicate","Good")
    It indicates all dupes regardless of table.
    I think this is good! Thank you so much everyone for your help!

  26. #26
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Not sure what I'm doing wrong here...

    At the risk of earning more negative rep, if that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  27. #27
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,908

    Re: Not sure what I'm doing wrong here...

    And as for that title...
    Rory

  28. #28
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Not sure what I'm doing wrong here...

    Yep!

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

    Re: Not sure what I'm doing wrong here...

    Quote Originally Posted by machinegod View Post
    I think this is good! Thank you so much everyone for your help!
    You're welcome & 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] Macro exporting and saving the wrong page with wrong name
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2018, 01:24 PM
  2. [SOLVED] VBA, IFs went wrong
    By moomphas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2018, 07:06 AM
  3. [SOLVED] Wrong formula or wrong function?
    By cpope in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-08-2017, 10:27 AM
  4. wrong macro? doing something wrong?
    By weatherguard in forum Excel General
    Replies: 1
    Last Post: 03-04-2016, 06:30 PM
  5. Wrong coding or RANDBETWEEN is wrong?
    By zbor in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-31-2013, 10:01 AM
  6. What am I doing wrong....!!!
    By squoggy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-02-2005, 01:05 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