📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Advice on Excel

Cotta
Cotta Posts: 3,667 Forumite
Hi All,


I've a little Excel query and I can't quite solve. What I have is in column "A" a list of job titles and in column B I need to convert these into specific titles.


So for example if Column A mentions "football" I need to convert this into "footballer," if column A mentions Food I need to convert this into Chef otherwise I need to return "other".


How do I write this code as none of my formulas are working?

Comments

  • droopsnoot
    droopsnoot Posts: 1,939
    Part of the Furniture 1,000 Posts Name Dropper
    Forumite
    =IF(ISNUMBER(SEARCH("food",A1)),"Chef",IF(ISNUMBER(SEARCH("football",E15)),"Footballer","Other"))


    Apparently the ISNUMBER function is required because of how SEARCH works - see here: http://www.mrexcel.com/forum/excel-questions/659723-nested-if-statement-search-find-text.html
  • rmg1
    rmg1 Posts: 3,159
    Part of the Furniture 1,000 Posts Name Dropper
    Forumite
    You'd be better off having a lookup table somewhere and then using VLOOKUP or INDEX/MATCH to bring back the correct response for each term.

    It would be quite easy to keep it up to date as well rather than having a (possibly) huge formula depending on the number of options.
    :wall: Flagellation, necrophilia and bestiality - Am I flogging a dead horse? :wall:

    Any posts are my opinion and only that. Please read at your own risk.
  • droopsnoot
    droopsnoot Posts: 1,939
    Part of the Furniture 1,000 Posts Name Dropper
    Forumite
    I wondered about using lookup, but if the OP wants any word or phrase containing "food" to come back as chef, would it mean you'd need to list every possible combination to make it work?
  • rmg1
    rmg1 Posts: 3,159
    Part of the Furniture 1,000 Posts Name Dropper
    Forumite
    Possibly, or you could use an array formula (that would take a while to calculate).
    The good thing about using a lookup is that you could just add to it as necessary as new words came in.
    :wall: Flagellation, necrophilia and bestiality - Am I flogging a dead horse? :wall:

    Any posts are my opinion and only that. Please read at your own risk.
This discussion has been closed.
★ ★ ★ Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 355.8K Banking & Borrowing
  • 254.9K Reduce Debt & Boost Income
  • 456.2K Spending & Discounts
  • 248.4K Work, Benefits & Business
  • 606K Mortgages, Homes & Bills
  • 179K Life & Family
  • 263.8K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.