+ Reply to Thread
Results 1 to 7 of 7

Formula to compare 2 columns and enter letters in a 3rd column if the 2 columns match

  1. #1
    Registered User
    Join Date
    09-21-2016
    Location
    California
    MS-Off Ver
    15.15
    Posts
    2

    Formula to compare 2 columns and enter letters in a 3rd column if the 2 columns match

    This is tricky to explain but I will try my best. There is a long list of schools in column B. In column N, there is a shorter list of some of the schools. I need to know a way to cross reference the schools in column N with the schools in column B. If they match, I need to put "NIR" in column C, in the same row. Please let me know if this is clear. Thank you!!!

  2. #2
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: Formula to compare 2 columns and enter letters in a 3rd column if the 2 columns match

    try this in column C

    =IF(ISERROR(VLOOKUP(B1,N:N,1,0)),"","NIR")

    This formula is taking information in Column B and seeing if it is in column N.

  3. #3
    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,193

    Re: Formula to compare 2 columns and enter letters in a 3rd column if the 2 columns match

    Try

    in C2

    =IFERROR(IF(MATCH(B2,$N$2:$N$1000,0),"NIR",""),"")

    Copy down

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to compare 2 columns and enter letters in a 3rd column if the 2 columns match

    One way...

    Data Range
    B
    C
    D
    N
    1
    ------
    ------
    ------
    ------
    2
    School1
    School8
    3
    School2
    School10
    4
    School3
    School4
    5
    School4
    NIR
    School7
    6
    School5
    School9
    7
    School6
    8
    School7
    NIR
    9
    School8
    NIR
    10
    School9
    NIR
    11
    School10
    NIR
    12
    School11


    This formula entered in C2 and copied down:

    =IF(COUNTIF(N$2:N$6,B2),"NIR","")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    09-21-2016
    Location
    California
    MS-Off Ver
    15.15
    Posts
    2

    Re: Formula to compare 2 columns and enter letters in a 3rd column if the 2 columns match

    These have potential!!! Thank you! The order of them is a little mixed up because the list of schools (in column B and N) do not start until row 4. How do I adjust the formula?

  6. #6
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: Formula to compare 2 columns and enter letters in a 3rd column if the 2 columns match

    =if(iserror(vlookup(b4,n:n,1,0)),"","nir")

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula to compare 2 columns and enter letters in a 3rd column if the 2 columns match

    Quote Originally Posted by jessie.black View Post
    list of schools (in column B and N) do not start until row 4. How do I adjust the formula?
    Like this...

    =IF(COUNTIF(N$4:N$20,B4),"NIR","")

    Adjust for the correct end of range where I've used N$20.

+ 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 if they match return a price from a 3rd column
    By ClermontPrinting in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-11-2015, 04:38 PM
  2. compare 2 columns if same lookup 3rd column and enter that data
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2014, 10:28 AM
  3. compare two columns and return match from third column
    By ozza89 in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 03-08-2014, 05:24 AM
  4. Replies: 4
    Last Post: 01-30-2014, 06:17 AM
  5. Replies: 3
    Last Post: 06-06-2013, 12:51 PM
  6. Replies: 4
    Last Post: 09-12-2012, 05:52 PM
  7. [SOLVED] Compare 2 columns and choose one and enter answer in third column
    By Betsy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-30-2006, 01:20 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