+ Reply to Thread
Results 1 to 15 of 15

Compare 2 columns and output in column C

  1. #1
    Registered User
    Join Date
    12-10-2018
    Location
    london
    MS-Off Ver
    O365
    Posts
    23

    Compare 2 columns and output in column C

    Hi

    I am trying to compare column A to B and then output the match in column C. So i want to check that everything that is in column B is in column A. The problem is that the data is not all aligned up between column A and B

    I want to match only the numbers not characters.

    thanks for any help

    here is column A and B

    emisnet-12923 12923
    emisnet-12926 12926
    emisnet-12946 12964
    emisnet-12964 13047
    emisnet-12992 13130
    emisnet-13037 13142
    emisnet-13047 13193
    emisnet-13065 13323
    emisnet-13121 14350
    emisnet-13130 14573
    emisnet-13136 14573
    emisnet-13142 14807
    emisnet-13154 14825
    emisnet-13163 14851
    emisnet-13184 14975
    emisnet-13193 15041
    emisnet-13275 15221
    emisnet-13307 15231
    emisnet-13319 15328
    emisnet-13323 15470
    emisnet-13331 15533
    emisnet-13357 15715
    emisnet-13366 15815
    emisnet-13383 15854
    emisnet-13472 15855

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,085

    Re: Compare 2 columns and output in column C

    does this work
    =IF(COUNTIF(A:A,"*"&B2)>0,B2,"")

    If not, then please attach a sample with expected results shown
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,598

    Re: Compare 2 columns and output in column C

    Administrative note

    Perhaps take a minute to acknowledge the help you have received in earlier thread(s) before continuing here?

  4. #4
    Registered User
    Join Date
    12-10-2018
    Location
    london
    MS-Off Ver
    O365
    Posts
    23

    Re: Compare 2 columns and output in column C

    Thanks yes your attachment is what i need. but there will be entries in colum B that will not exist in column A so does that mean in column C for that entry the box will be left blank?

  5. #5
    Registered User
    Join Date
    12-10-2018
    Location
    london
    MS-Off Ver
    O365
    Posts
    23

    Re: Compare 2 columns and output in column C

    Actually is not working quite correctly. if you look at the spreadsheet attached. the entry 52982 exists in column B bot not in A but yet in column C it is there. I would
    want it so that in column C it indicates that 52982 is not in column A, it an be either highlighted in color or something like "FALSE". Thanks

    see attachment
    Attached Files Attached Files

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,085

    Re: Compare 2 columns and output in column C

    so does that mean in column C for that entry the box will be left blank?
    yes it does

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,598

    Re: Compare 2 columns and output in column C

    Have you read post #3??

  8. #8
    Registered User
    Join Date
    12-10-2018
    Location
    london
    MS-Off Ver
    O365
    Posts
    23

    Re: Compare 2 columns and output in column C

    Actually is not working quite correctly. if you look at the spreadsheet attached. the entry 52982 exists in column B bot not in A but yet in column C it is there. I would
    want it so that in column C it indicates that 52982 is not in column A, it an be either highlighted in color or something like "FALSE". Thanks

    see attachment
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-10-2018
    Location
    london
    MS-Off Ver
    O365
    Posts
    23

    Re: Compare 2 columns and output in column C

    Quote Originally Posted by etaf View Post
    yes it does
    Actually is not working quite correctly. if you look at the spreadsheet attached. the entry 52982 exists in column B bot not in A but yet in column C it is there. I would
    want it so that in column C it indicates that 52982 is not in column A, it an be either highlighted in color or something like "FALSE". Thanks

    see attachment
    Attached Files Attached Files

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,085

    Re: Compare 2 columns and output in column C

    it does work your formula is incorrect

    you have
    =IF(COUNTIF(A:A,"*"&B2)>0,B1,"")
    so it looking at the row below the one tested
    change to
    =IF(COUNTIF(A:A,"*"&B1)>0,B1,"")

    you can use
    =COUNTIF(A:A,"*"&B1)>0
    in a conditional format formula to colour the cell

    OR change
    =IF(COUNTIF(A:A,"*"&B1)>0,B1,"")

    to
    =IF(COUNTIF(A:A,"*"&B1)>0,B1,FALSE)

    so instead of a blank you get the FALSE in the cell

  11. #11
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,085

    Re: Compare 2 columns and output in column C

    @Pepe Le Mokko
    yes, did you want all answers to now stop , until you allow ? not sure what or who the reference was for

    Perhaps take a minute to acknowledge the help you have received in earlier thread(s) before continuing here?
    I have search and seen another duplicate here
    https://www.excelforum.com/excel-gen...ml#post5109125

  12. #12
    Registered User
    Join Date
    12-10-2018
    Location
    london
    MS-Off Ver
    O365
    Posts
    23

    Re: Compare 2 columns and output in column C

    Quote Originally Posted by etaf View Post
    it does work your formula is incorrect

    you have
    =IF(COUNTIF(A:A,"*"&B2)>0,B1,"")
    so it looking at the row below the one tested
    change to
    =IF(COUNTIF(A:A,"*"&B1)>0,B1,"")

    you can use
    =COUNTIF(A:A,"*"&B1)>0
    in a conditional format formula to colour the cell

    OR change
    =IF(COUNTIF(A:A,"*"&B1)>0,B1,"")

    to
    =IF(COUNTIF(A:A,"*"&B1)>0,B1,FALSE)

    so instead of a blank you get the FALSE in the cell

    Thanks but if you look at 18758 this exists in column A and B but it is blank in C, it should appear in C well. i want to make sure all that appear in column B also appear in column A, that ones that dont should be highlighted in column C. so i dont think the formula is correct

  13. #13
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,085

    Re: Compare 2 columns and output in column C

    have you changed the formula

  14. #14
    Registered User
    Join Date
    12-10-2018
    Location
    london
    MS-Off Ver
    O365
    Posts
    23

    Re: Compare 2 columns and output in column C

    thanks i tried it again its working

  15. #15
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,598

    Re: Compare 2 columns and output in column C

    Quote Originally Posted by etaf View Post
    @Pepe Le Mokko
    yes, did you want all answers to now stop , until you allow ?
    Hi etaf,
    no problems, there is no rule about lack of courtesy. I am just trying to make the OP understand, but he does not seem to care.
    I'll close the post you mentioned.
    Thanls

+ 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. Compare 2 columns and output in column C
    By hiranuk in forum Excel General
    Replies: 2
    Last Post: 04-29-2020, 08:17 AM
  2. [SOLVED] Compare two columns of data and output contents of a third column when there is a match
    By BENTLEY1984 in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 04-11-2018, 10:00 AM
  3. how to compare 2 columns & output 3rd column
    By Babylon65 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-10-2016, 12:35 PM
  4. [SOLVED] macro to compare two columns, and then output an answer into a different column.
    By emilyloz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2013, 09:50 AM
  5. Compare the two columns and display the 2nd column item as output
    By gurum in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-25-2013, 07:58 AM
  6. Compare 2 columns near equiv (one has text included) and output to new column
    By CNE5x in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2012, 01:24 PM
  7. [SOLVED] Compare 2 columns and output to a 3rd column
    By jamaican jewel in forum Excel General
    Replies: 1
    Last Post: 03-22-2006, 05:30 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