+ Reply to Thread
Results 1 to 8 of 8

IF Statement to Mark with Yes & Mark Duplicates

  1. #1
    Registered User
    Join Date
    01-04-2020
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    36

    IF Statement to Mark with Yes & Mark Duplicates

    Hi,
    '
    I am looking for a formula that marks "Yes" or "No". If it says "1" in column AE, I would like it to mark in Column AF with "Yes". I would also like it to mark it "Yes" on every duplicate occurance of the same Column A number.

    For example in the document provided, I would want all of the highlighted to be marked "Yes". These are all of the Column A numbers that at one time had the number 1 in column AE. Thank you!!!
    Attached Files Attached Files
    Last edited by AliGW; 01-19-2020 at 04:07 AM. Reason: Poor thread title improved.

  2. #2
    Registered User
    Join Date
    12-01-2019
    Location
    USA
    MS-Off Ver
    365
    Posts
    21

    Re: IF Statement

    I'm assuming this logic:

    1. If AE is 1, say Yes
    2. If there's a duplicate value, say Yes

    Which would be this for row 2:

    =IF(OR(AE2=1,COUNTIF(A$2:A$9,A2)>1),"Yes","")

  3. #3
    Registered User
    Join Date
    01-04-2020
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: IF Statement

    Hi,

    There seems to be a problem with this.

    It put a "Yes" for the rows that had values of 129 in Column A. These were duplicate values, but did not contain a "1" in Column AE. I would like it to only do those that had one instance of a "1" in Column AE. Thank you for your help!

  4. #4
    Registered User
    Join Date
    01-04-2020
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    36
    Quote Originally Posted by alexdi View Post
    I'm assuming this logic:

    1. If AE is 1, say Yes
    2. If there's a duplicate value, say Yes

    Which would be this for row 2:

    =IF(OR(AE2=1,COUNTIF(A$2:A$9,A2)>1),"Yes","")
    I think the logic would be more “if AE is 1 then all of the same number in column A are “Yes”

  5. #5
    Registered User
    Join Date
    12-01-2019
    Location
    USA
    MS-Off Ver
    365
    Posts
    21

    Re: IF Statement

    Cheap and cheerful to use a helper column. See attached.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-04-2020
    Location
    America
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: IF Statement

    Quote Originally Posted by alexdi View Post
    Cheap and cheerful to use a helper column. See attached.
    This works great! Thank you very much! Could you explain to me the logic this formula uses to make this work? Thanks. Reputation added.

  7. #7
    Registered User
    Join Date
    12-01-2019
    Location
    USA
    MS-Off Ver
    365
    Posts
    21

    Re: IF Statement

    Sure. Here's the meat:

    =IF(OR(AE2=1,COUNTIF(AF$2:AF$9,A2&"_1")),"Yes","")

    So,

    Please Login or Register  to view this content.
    The helper column AF just exists because I couldn't easily throw the A+AE combination into the COUNTIF function.

  8. #8
    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: IF Statement to Mark with Yes & Mark Duplicates

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are still new here, I have done it for you this time.)
    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.

+ 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] i have an if then statement that works, how to make it work as a with or case statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2016, 03:34 PM
  2. [SOLVED] If statement to select data - nested statement - assistance
    By petitesouris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-29-2015, 09:55 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

Tags for this Thread

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