+ Reply to Thread
Results 1 to 5 of 5

If statement - does value in cell "a" occur anywhere in column "b".

Hybrid View

Emmadw If statement - does value in... 01-30-2009, 12:27 PM
DonkeyOte Re: If statement - does value... 01-30-2009, 12:29 PM
Emmadw Re: If statement - does value... 01-30-2009, 12:51 PM
DonkeyOte Re: If statement - does value... 01-30-2009, 01:01 PM
Emmadw Re: If statement - does value... 01-30-2009, 02:57 PM
  1. #1
    Registered User
    Join Date
    01-30-2009
    Location
    Portsmouth
    MS-Off Ver
    Excel 2007 (or 2003)
    Posts
    3

    If statement - does value in cell "a" occur anywhere in column "b".

    Sorry the title isn't clearer.

    I've got two lists - (text, but could be converted to number if easier - they're course codes which start with letter, but I could drop that)

    I need to take each value from the longer list (c. 900 items) & see if it occurs anywhere in the shorter list (c. 600 items) & to return a 1/0.

    It struck me that I should be using some form of nested "if" statement, but the actual logic required is a bit beyond me.

    Most of the functions seem to require an array to match against - and as far as I can see, I have to enter that array, I can't use a column to form it.

    I did try VLOOKUP - but that seemed to want me to return a value that it found in a different column - so I added a column of 1s ...

    but I'm clearly doing something wrong!

    At the moment, the two columns of numbers are on different sheets.

    I've got Office 2007 here, but have 2003 at home, if it works better in that.
    Last edited by Emmadw; 02-07-2009 at 12:35 PM. Reason: Worked! Many thanks.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If statement - does value in cell "a" occur anywhere in column "b".

    Assuming you're list of 900 items is in A1:A900

    B1: =--ISNUMBER(MATCH($A1,List2!$A$1:$A$600,0))

    were List2!A1:A600 is the range containing the shorter list... return of 1 = match.

  3. #3
    Registered User
    Join Date
    01-30-2009
    Location
    Portsmouth
    MS-Off Ver
    Excel 2007 (or 2003)
    Posts
    3

    Re: If statement - does value in cell "a" occur anywhere in column "b".

    Gosh, that was quick ... I'll just try it.

    Just a quick question - do the values I'm searching have to be in col A in both sheets? They aren't currently, but I could move them.

    Thanks

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If statement - does value in cell "a" occur anywhere in column "b".

    No they needn't be in A - just alter the sample references per your real data.

  5. #5
    Registered User
    Join Date
    01-30-2009
    Location
    Portsmouth
    MS-Off Ver
    Excel 2007 (or 2003)
    Posts
    3

    Re: If statement - does value in cell "a" occur anywhere in column "b".

    Wonderful! I've just done a wee test on a set of 3 bits of data ... and it works. You're a star

+ 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