+ Reply to Thread
Results 1 to 5 of 5

Possible? Trying to do a wild card search...

  1. #1
    Registered User
    Join Date
    04-01-2005
    Posts
    29

    Possible? Trying to do a wild card search...

    I want to set up a if statement without having to write a long OR statement capturing all possible values. Here's an example of what I would like to do...

    Say if I have a bunch of different values including...

    Eastern Europe
    Western Europe
    Central Europe

    I would like to set up a if statement in a seperate column that would search within this column for anything that contains Europe (*Europe*) and replace it with "Europe". Text may not be at the end of the string

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Thumbs up

    Quote Originally Posted by andyd2k
    I want to set up a if statement without having to write a long OR statement capturing all possible values. Here's an example of what I would like to do...

    Say if I have a bunch of different values including...

    Eastern Europe
    Western Europe
    Central Europe

    I would like to set up a if statement in a seperate column that would search within this column for anything that contains Europe (*Europe*) and replace it with "Europe". Text may not be at the end of the string
    Hi andyd2k,

    Try this formula

    =IF(A6="Europe","Europe",RIGHT(A6,LEN(A6)-FIND(" ",A6)))

    when you say "Text may not be at the end of the string", I'm assuming you just have Europe in the cell?

    oldchippy

  3. #3
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by andyd2k
    I want to set up a if statement without having to write a long OR statement capturing all possible values. Here's an example of what I would like to do...

    Say if I have a bunch of different values including...

    Eastern Europe
    Western Europe
    Central Europe

    I would like to set up a if statement in a seperate column that would search within this column for anything that contains Europe (*Europe*) and replace it with "Europe". Text may not be at the end of the string
    here is a trick
    copy this column to another column.
    select that new column
    press Ctrl+H
    in Find what: type *Europe* (with * at both ends of Europe)
    in Replace with: type Europe
    press Replace All.

    hope this would do what you have asked for.

  4. #4
    Registered User
    Join Date
    04-01-2005
    Posts
    29
    Quote Originally Posted by oldchippy
    Hi andyd2k,

    Try this formula

    =IF(A6="Europe","Europe",RIGHT(A6,LEN(A6)-FIND(" ",A6)))

    when you say "Text may not be at the end of the string", I'm assuming you just have Europe in the cell?

    oldchippy
    I meant that the word may be anywhere in the string (i.e. "Europe" may be at the start or middle of the string)

    Starguy, thanks for the tip. Didn't know you can do that. Won't work for this though as I'm trying to automate something as much as possible for something that I colleague and I work on weekly

  5. #5
    Registered User
    Join Date
    07-27-2006
    MS-Off Ver
    MS Office 2007
    Posts
    79
    Try this...

    =IF(ISERROR(FIND("Europe",A1,1)),"","Europe")

    but you have to make sure that ALL "Europe"s in the list are of the same case (only one capital E)

    hope this is what you want
    TL

    https://sites.google.com/site/teelim/
    My page of "not so useful" spreadsheets

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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