+ Reply to Thread
Results 1 to 2 of 2

Adding Brackets Around A Word Based On Word In Another Column

  1. #1
    Registered User
    Join Date
    03-09-2009
    Location
    Rochester, NY, USA
    MS-Off Ver
    Excel 2007
    Posts
    25

    Adding Brackets Around A Word Based On Word In Another Column

    Hi,

    I'd like to add brackets or quote marks around words in column A based on the word in column B.

    For example:

    pretty flowers | exact
    bright flowers | phrase
    large yellow flowers | exact

    Will become:

    [pretty flowers]
    "bright flowers"
    [large yellow flowers]

    How would I go about accomplishing this task?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Adding Brackets Around A Word Based On Word In Another Column

    Assuming your data is in A1:B3, then in C1:

    =IF(B1="exact","["&A1&"]",IF(B1="phrase",""""&A1&"""",A1))

    copied down

    Then you can copy and paste special >>> values over column A, if desired and delete column C.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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