+ Reply to Thread
Results 1 to 6 of 6

(Dummy-variable) Search for list of numbers in cell and return 1 or 0

  1. #1
    Registered User
    Join Date
    11-10-2020
    Location
    norway
    MS-Off Ver
    2008
    Posts
    3

    (Dummy-variable) Search for list of numbers in cell and return 1 or 0

    Hi guys,
    I need to create dummy-variables of adresses in a dataset. How i plan to do this is searching the adress cell and check if it contains a postnumber from a list of postnumbers and then either return 1 or 0 into the result cell.

    I tried using =IF(ISNUMBER(SEARCH())) but if i put in a list of objects to search for the postnumbers) then it will return a "SPILL" error.
    Basicly it seems using this function this way creates a corresponding amount of result cells to the amount of objects it is searching for.

    I need a function or method that only writes 1 or 0 to one result cell if any of the numbers searching for is found.

    Grateful for all help.
    Attached Files Attached Files
    Last edited by notyr; 11-17-2020 at 07:36 AM.

  2. #2
    Forum Guru Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2010 on Linux
    Posts
    11,757

    Re: (Dummy-variable) Search for list of numbers in cell and return 1 or 0

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Registered User
    Join Date
    11-10-2020
    Location
    norway
    MS-Off Ver
    2008
    Posts
    3

    Re: (Dummy-variable) Search for list of numbers in cell and return 1 or 0

    Attached an example sheet.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    9,220

    Re: (Dummy-variable) Search for list of numbers in cell and return 1 or 0

    Hi & welcome to the board.
    How about
    =--(COUNT(IFERROR(SEARCH({579,657},A2),""))>0)

  5. #5
    Registered User
    Join Date
    11-10-2020
    Location
    norway
    MS-Off Ver
    2008
    Posts
    3

    Re: (Dummy-variable) Search for list of numbers in cell and return 1 or 0

    Yeah that works perfectly ! Thanks !

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    9,220

    Re: (Dummy-variable) Search for list of numbers in cell and return 1 or 0

    You're welcome & thanks for the feedback.

+ 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] Search for a value in a row, return list of cells below that particular cell
    By fendersony in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-20-2019, 06:09 AM
  2. [SOLVED] Search for a variable and return value of another cell
    By terratushi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-15-2018, 06:20 AM
  3. [SOLVED] Search list for cell value, return or highlight cells that contain value
    By dusty90 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-16-2016, 09:40 PM
  4. Replies: 7
    Last Post: 03-30-2015, 11:34 AM
  5. [SOLVED] Search for a word within a list of names and return the entire name within the cell.
    By staljunk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-02-2015, 04:50 PM
  6. Using a Dummy Variable
    By chadnchady in forum Excel General
    Replies: 2
    Last Post: 10-01-2012, 09:22 AM
  7. Need help to generate a dummy variable
    By vme2 in forum Excel General
    Replies: 2
    Last Post: 11-21-2010, 04:16 AM

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