+ Reply to Thread
Results 1 to 7 of 7

Flag columnA only if column B matches

  1. #1
    Registered User
    Join Date
    09-01-2010
    Location
    England
    MS-Off Ver
    Excel 2010/13
    Posts
    17

    Flag columnA only if column B matches

    The description sounds simple but what I need is a bit more complicated.

    I have a table of transactions.

    Column A contains part numbers
    Column B contains a list of transaction codes.

    Now each part number may have multiple transaction codes.

    What I need is to flag if a part number has a TYPE1 transaction AND a TYPE2 OR TYPE3

    for example the following image shows a TYPE1 and TYPE2 transaction. In column C I would want a flag to say there is a match.

    ADJ.JPG

    I have tried this:

    Please Login or Register  to view this content.
    but it doesn't work, any ideas?

    Thanks
    Last edited by Goldbadger; 11-24-2016 at 07:29 AM. Reason: added image

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Flag columnA only if column B matches

    You could try it like this:

    =SUMPRODUCT(([PartNumber]=[@PartNumber])*([TransactionCode]="TYPE1")*(([TransactionCode]="TYPE2")+([TransactionCode]="TYPE3")))

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    09-01-2010
    Location
    England
    MS-Off Ver
    Excel 2010/13
    Posts
    17

    Re: Flag columnA only if column B matches

    Thanks for the reply Pete, I tried the formula and it returns a zero.

    I have attached an image to my original post. I was hoping to return a 1 or something to flag there was a match. Maybe I'm asking for the wrong formula?

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Flag columnA only if column B matches

    We can't do much with a picture - it would be better if you attached a sample Excel workbook.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Pete

  5. #5
    Registered User
    Join Date
    09-01-2010
    Location
    England
    MS-Off Ver
    Excel 2010/13
    Posts
    17

    Re: Flag columnA only if column B matches

    thanks, please see attached.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,207

    Re: Flag columnA only if column B matches

    Try

    =IF(COUNTIFS([PartNumber],[@PartNumber],[TransactionCode],"TYPE1"),IF(COUNTIFS([PartNumber],[@PartNumber],[TransactionCode],"TYPE2")+COUNTIFS([PartNumber],[@PartNumber],[TransactionCode],"TYPE3"),1,""),"")

  7. #7
    Registered User
    Join Date
    09-01-2010
    Location
    England
    MS-Off Ver
    Excel 2010/13
    Posts
    17

    Re: Flag columnA only if column B matches

    Hi John,

    Thank you, your formula works perfectly.

    Pete, thanks for your assistance, much appreciated.

+ 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. Replies: 6
    Last Post: 01-15-2016, 10:28 PM
  2. Filter Wksht2.ColumnA on Values from Wksht1.ColumnA
    By athyeh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2014, 04:46 PM
  3. [SOLVED] Find value X in columnA and paste entire row above value Y in columnA
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-27-2012, 06:25 AM
  4. Hard? SUM the values of a column that matches a flag in an adjacent column
    By Nokao in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-07-2012, 11:29 AM
  5. Matching values in Sheet1 ColumnA from values in SHeet 2 ColumnA
    By hood8jmark in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-29-2008, 06:50 PM
  6. IF ColumnA = ltr Add Column B
    By maril in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-20-2006, 05:40 PM
  7. Replies: 14
    Last Post: 09-06-2005, 03: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