+ Reply to Thread
Results 1 to 5 of 5

How to check if numbers contained in a cell are also in another cell (or a better method)

  1. #1
    Registered User
    Join Date
    03-06-2013
    Location
    Prague
    MS-Off Ver
    M365, version 2304
    Posts
    40

    How to check if numbers contained in a cell are also in another cell (or a better method)

    Hi all

    I have a spreadsheet like the below, where I am trying to figure out if the values in column B are contained in their corresponding cell in column A. I am using the following formula in column C:

    =IF(ISNUMBER(SEARCH(B2,A2,1)),"Pass","Fail")

    ContainedInCells_Test.JPG

    The problem is with row 3, which should have a Pass Status. Even though the full text string in B isn't contained in A, the actual numbered categories are.

    I am trying (if possible) to avoid any long-winded splitty windey way to achieve this, and my vaguest thought is if I can check by 3 digit number values between the two cells somehow. All values are consistent in that they are a three digit number, and then a dash, and then the text.

    Is it possible to do something like this, or would there be another relatively simple way?

    Thanks!

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: How to check if numbers contained in a cell are also in another cell (or a better meth

    Please try C2
    =IF(COUNT(SEARCH(TRIM(MID(SUBSTITUTE(B2,"|",REPT(" ",99)),{1,2,3}*99-98,99)),A2))=3,"Pass","Fail")

  3. #3
    Registered User
    Join Date
    03-06-2013
    Location
    Prague
    MS-Off Ver
    M365, version 2304
    Posts
    40

    Re: How to check if numbers contained in a cell are also in another cell (or a better meth

    Oh wow - that works perfectly!! Thank you so much! Do you mind walking me through it?

  4. #4
    Registered User
    Join Date
    03-06-2013
    Location
    Prague
    MS-Off Ver
    M365, version 2304
    Posts
    40

    Re: How to check if numbers contained in a cell are also in another cell (or a better meth

    Hi again. Unfortunately, where there are more than three categories "on the shelf", this doesn't seem to pick up on them (now the shop sells colours).

    ContainedInCells_Test2.JPG

    Here, it passed, even through the second two categories are not "in the shop. There could be anything up to 30 categories unfortunately.

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: How to check if numbers contained in a cell are also in another cell (or a better meth

    Not tested

    =IF(COUNT(SEARCH(TRIM(MID(SUBSTITUTE(B2,"|",REPT(" ",99)),{1,2,3,4,5,6,7,8,9}*99-98,99)),A2))=9,"Pass","Fail")

    A. TRIM(MID(SUBSTITUTE(B2,"|",REPT(" ",99)),{1,2,3,4,5,6,7,8,9}*99-98,99)),A2) use for seperate text by dilimeter "|" 1-9 for up to 9 products
    https://exceljet.net/formula/split-text-with-delimiter

    B. Search(A,A2) = 9 check if each product found in A2 , give number if found and give #VALUE! if not found
    C. If(Count(B)=9,"Pass","Fail") count only number, if found all 9 products give 9 then show "Pass" , if not show "Fail"

+ 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. [SOLVED] Check if a cell value is contained between two bounding cells
    By Supersadie in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-03-2018, 06:02 AM
  2. [SOLVED] add list of numbers contained in a single cell
    By sick stigma in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2017, 04:37 PM
  3. [SOLVED] If a cell is contained in a range, then WORD, if not go check in another range...
    By Marta Garcia in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-15-2016, 07:24 AM
  4. Replies: 4
    Last Post: 05-09-2007, 07:30 PM
  5. Replies: 3
    Last Post: 01-31-2006, 08:30 AM
  6. copying the function contained within a cell to anouther cell.
    By Gary's Student in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 09:05 AM
  7. [SOLVED] copying the function contained within a cell to anouther cell.
    By DMB in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM

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