+ Reply to Thread
Results 1 to 6 of 6

Need Function to search columns and return a value.

  1. #1
    Registered User
    Join Date
    01-03-2011
    Location
    Birmingham, Alabama
    MS-Off Ver
    Excel 2010
    Posts
    8

    Question Need Function to search columns and return a value.

    Hello,

    I have 4 columns 1st contains numbers, the 2nd contains dates

    The 3rd and 4th columns contains numbers and dates as well.


    I would like to compare the sets of two columns to one another.


    For example.

    Column 1 row 1 contains 1234
    Column 2 row 1 contains 1-11-11

    Column 3 row 25 contains 1234
    Column 4 row 25 contains 2-15-99


    So the formula would find the matches between column 1 and 3 and then tell the user if there is a differnce in the dates in columns 2 and 4. In this case it would place YES in a new column (I guess column 5)

    Can this be done or do I need to look into VBA?

    Thanks,

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Need Function to search columns and return a value.

    Try:

    =IFERROR(IF(Vlookup(A2,C:D,2,0)=B2,"No","Yes"),"")

    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Need Function to search columns and return a value.

    Hello there,

    Try the following in cell E1

    =IF(VLOOKUP(A1,C:D,2,FALSE)-B1<>0,"YES","")

    You could copy this formula down to the last row of your data.

  4. #4
    Registered User
    Join Date
    01-03-2011
    Location
    Birmingham, Alabama
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Need Function to search columns and return a value.

    Quote Originally Posted by rvasquez View Post
    Hello there,

    Try the following in cell E1

    =IF(VLOOKUP(A1,C:D,2,FALSE)-B1<>0,"YES","")

    You could copy this formula down to the last row of your data.
    THis is exactly what I needed. Thanks to you both for your time.

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Need Function to search columns and return a value.

    Glad to help! Don't forget to mark this thread solved and possibly give a little star tap if I helped.

    Thanks!

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Need Function to search columns and return a value.

    @ SirDrums

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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