+ Reply to Thread
Results 1 to 5 of 5

IF THEN formula help

  1. #1
    Registered User
    Join Date
    10-08-2012
    Location
    Chicago ⇄ L.A.
    MS-Off Ver
    365
    Posts
    30

    IF THEN formula help

    Hey all. Wondering if someone can help me. I was googling IF and THEN tutorials but couldn't really find one that would help with what I'm specifically trying to do.


    Trying to have a formula that would do this:

    IF CELL A1 = A, B, C, D, E... then X
    IF CELL A1 = F, G, H, I, J (etc)... then Y

    These are not numeric values, they are words...

    For example

    IF CELL A1 = CAT, DOG, BIRD... then PET
    IF CELL A1 = CAR, TRUCK, TIRE... then AUTO

    I've got about 20 items to put in the "IF" part, and about 10 different "THEN" results... is this possible to have that many?

    Thanks in advance!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,819

    Re: IF THEN formula help

    You could do it like this:

    =IF(ISNUMBER(SEARCH(A1,"Cat,Dog,Bird")),"Pet",IF(ISNUMBER(SEARCH(A1,"Car,Truck,Tire")),"Auto",""))

    Just add more words within the quotes, as required (you don't strictly need the commas between the words, but it helps to make the words more recognisable).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-08-2012
    Location
    Chicago ⇄ L.A.
    MS-Off Ver
    365
    Posts
    30

    Re: IF THEN formula help

    Thank you. How do I add a 3rd, 4th 5th (and so on) category though?

    For example:

    IF Cell A = Blue, Red, Green, Yellow...... THEN color
    IF Cell A = Couch, Chair, Table...... THEN house

    I'll have about 10 different THEN/categories... not sure if it can be this long?


    My actual formula (THEN) is going to have units of measure: EA, SY, LF, SF, SET, etc.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,453

    Re: IF THEN formula help

    In that case perhaps create a small table somewhere ( say AA1:AB10) with search terms in the 1st column and results in the second

    And use a VLOOKUP like =VLOOKUP(A1,$AA$1:$AB$10,2,0) or an INDEX/MATCH combination to retrieve the values

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,819

    Re: IF THEN formula help

    Why don't you attach a sample workbook which will show all the variations that you want to cover, then we can cater for them all in one go.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post. Don't try to use the Paperclip icon, as it is broken on this forum.

    Hope this helps.

    Pete

+ 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. Replies: 3
    Last Post: 01-10-2019, 09:34 AM
  2. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  3. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  4. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  5. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  6. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 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