+ Reply to Thread
Results 1 to 4 of 4

comparison with simple 'if' formula

  1. #1
    Registered User
    Join Date
    05-12-2010
    Location
    Bergen, Norway
    MS-Off Ver
    Excel 2003
    Posts
    6

    comparison with simple 'if' formula

    I have to compare two sets of numbers to find out which are not present in the other.

    Let's say I have one column with 4 cells: 1,2,3,4 and another column with 1,2,4. What I want to do is to have a simple formula that returns 'Yes' if the cell in the first column has an equivalent in any cell of the other column or 'No' if there's no such an equivalent found in any cell of the second column.

    So if I use the data example above I would get:
    1 Yes
    2 Yes
    3 No
    4 Yes

    I just have no idea how I can reference to a range of cells - I know how to compare one cell with another single cell - but I don't know how to compare one cell with any cell within a range of cells. Let's say from B2 to B100

    I hope someone has an answer
    Last edited by BigPole; 05-12-2010 at 07:12 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Can it be solved with simple 'if' formula

    You can use this formula in C1 to check whether B1 matches any cell in A1:A100

    =IF(COUNTIF(A$1:A$100,B1),"Yes","No")

    You can then copy that down the column to compare subsequent column B values against the same range

  3. #3
    Registered User
    Join Date
    05-12-2010
    Location
    Bergen, Norway
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: comparison with simple 'if' formula

    Thank you

    Is there a rating system on this Forum? how do I mark that your answer was helpful/solved the problem?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: comparison with simple 'if' formula

    You can "add to my reputation", should you so wish, by clicking on the "scales" icon at the top of my post. I marked the thread "Solved"......

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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