+ Reply to Thread
Results 1 to 8 of 8

Search results of a column display a set value in another column if matched

  1. #1
    Registered User
    Join Date
    08-23-2010
    Location
    carmel, indiana
    MS-Off Ver
    Excel 2007
    Posts
    8

    Exclamation Search results of a column display a set value in another column if matched

    Hello,

    I need a little help. Is there a way to search a column for a specific word or phrase, then if that phrase matches assign a value next to it.

    For example:

    A1 | B1

    John Realty | Realtor
    Jim Appraiser |
    Bob the Realtor | Realtor

    If search results from column A = appraiser, then add "Appraiser" to column B1 where the search value is 'true'. The result should be:

    A1 | B1

    John Realty | Realtor
    Jim Appraiser | "Appraiser"
    Bob Realtor | Realtor

    I have approximately 10,000 records and a search and replace doesn't seem very time effective.

    Thanks for any help.

    Ryan.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Search results of a column display a set value in another column if matched

    =if(isnumber(search("realt",a1)),"Realtor",if(isnumber(search("appraiser",a1)),"Appraiser"))

    Add more nested IFs as needed.

  3. #3
    Registered User
    Join Date
    08-23-2010
    Location
    carmel, indiana
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Search results of a column display a set value in another column if matched

    Hi,

    This almost works. Maybe I'm doing something wrong.

    I've attached a sample sheet for review.

    Thanks,
    Ryan.
    Attached Files Attached Files

  4. #4
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Search results of a column display a set value in another column if matched

    It seems not all items have "realt" in them. I need to know the full set of your parameters to code for every one of them.


    Here's the function logic, so you can try to piece it together:

    SEARCH(for what, where) = Provides starting character. So, SEARCH("some","awesome") = 4. No match creates an error.

    ISNUMBER(what) = Test to see if something is a number, True/False. Errors are not numbers, they create false.

    IF(if what,when it's true, when it's false)

    Assuming A1 = Bob the Realtor

    B1 = IF(ISNUMBER(SEARCH("realt",A1)),"REALTOR","NOT VERY SPECIAL")

    =IF(ISNUMBER(9),"REALTOR","NOT VERY SPECIAL")

    ISNUMBER(9) = TRUE, therefore the output will be "REALTOR"


    You can nest IFs by simply adding a second IF at the False statement.

    Assuming A1 = Five

    B1 = if(a1="One",1,if(a1="Two",2,if(a1="Three",3,if(a1="Four",4,if(a1="Five",5,"No Match")))))

    = 5

  5. #5
    Registered User
    Join Date
    08-23-2010
    Location
    carmel, indiana
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Search results of a column display a set value in another column if matched

    Hi,

    Your first example works great. I just need to adjust for the variables and then fix the circular ref I created.

    How do I return a value for "FALSE" ? For example if neither matches, then show result = "Realtor"

    Ryan.
    Last edited by rkrause54; 09-12-2013 at 01:40 PM.

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Search results of a column display a set value in another column if matched

    The output is assumed FALSE if no actual condition is specified. So, to make Realtor the output we just have to delcare it.

    Original:
    =if(isnumber(search("realt",a1)),"Realtor",if(isnumber(search("appraiser",a1)),"Appraiser"[no FALSE declaration]))

    Revised:
    =if(isnumber(search("realt",a1)),"Realtor",if(isnumber(search("appraiser",a1)),"Appraiser","Realtor"))

  7. #7
    Registered User
    Join Date
    08-23-2010
    Location
    carmel, indiana
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Search results of a column display a set value in another column if matched

    Ah, got it. Didn't think about it already being a false value.

    Thanks a lot for the help - saved me an enormous amount of time.

    Ryan.

  8. #8
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Search results of a column display a set value in another column if matched

    Process Improvement is my middle name.

+ 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. Find value of a column in another column an display results
    By s_anr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-21-2013, 09:43 AM
  2. Excel search - Display a third column in the results
    By johnrrinc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-06-2012, 11:57 AM
  3. [SOLVED] Display multiple search results by column
    By Declan.Ryan in forum Excel General
    Replies: 19
    Last Post: 11-09-2012, 08:51 AM
  4. Search column for non-empty cell and display results?
    By Kiltman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-30-2007, 07:34 PM
  5. Replies: 3
    Last Post: 08-01-2006, 08:15 PM

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