+ Reply to Thread
Results 1 to 8 of 8

Need to combine several IF statements together

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    6

    Need to combine several IF statements together

    I am trying to create a spreadsheet that will look in column C for a specific word, then depending on what word it sees, return a specific word in column A. However, if column D has the word "decline" in it, then the corresponding cell in column A needs to be blank.

    For example, Cell A1 needs to look at cell C1 and determine if the word nutrition, camp, or private is in that cell. If nutrition is there, it will return the word nutrition in cell A1. However, if cell d1 has the word declined, then cell A1 needs to remain blank.

    I figured out the formula to make Column A look into C for the word nutrition using an if statement but am unable make a string of this function to achieve my goal. Any tips/tutorials/etc would be emmensely helpful.

    Here is what I have so far:

    =IF(NOT(ISERROR(SEARCH("nutrition",C2))),"nutrition")

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094

    Re: Need to combine several IF statements together

    Hi,

    Try something like,

    =IF(AND(C1="Nutrition",B1<>"Declined"),"Nutrition","")

    HTH
    Steve

  3. #3
    Registered User
    Join Date
    06-12-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to combine several IF statements together

    Hi Steve,

    Thank you for the fast response. I didn't clarify my issue well in the original post. I cannot use the equal sign for the first IF statments in this function because the cell in column 3 contain strings of words. For example, "3 private 30-minute nutrition coaching sessions every other week". I need a statement that can look through that string and determine if a specific word is there. In this specific case, the word nutrition. Nutrition would then return in the corresponding cell in column A. However the string of words might contain camp, or health in which case I need a different word to return to the corresponding cell in column A.

    The only IF statement I can use an equal size on is for column D because that just says approved or declined.

    Does it makes sense what I am saying?

    Thanks!

    Summer

  4. #4
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094

    Re: Need to combine several IF statements together

    Hi,

    Can all of the words (nutrition, camp, health) exist in the same string? If so, is there a priority order in which one, if it exists, takes precedence over the others and so on?

    THanks,
    Steve

  5. #5
    Registered User
    Join Date
    06-12-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to combine several IF statements together

    No, there will not be a situation where the words will be in the same string. I am trying to rig a system. Basically we export an excel spreadsheet from our payment software to tell us much money we made that month. But the exported file is just a bunch of raw data so I need to categorize it. My plan is to write a formula that can look for a specific word in the string of text in the description column (in this case column c) and then assign it a predetermined category in column A (from there I can make functional graphs and such). For simplicity, I am making sure to select words that will not appear in the same string.

  6. #6
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094

    Re: Need to combine several IF statements together

    Hi,

    Try this:

    =IF(AND(ISERROR(SEARCH("nutrition",C1,1))=FALSE,B1<>"declined"),"nutrition",IF(AND(ISERROR(SEARCH("camp",C1,1))=FALSE,B1<>"declined"),"camp",IF(AND(ISERROR(SEARCH("health",C1,1))=FALSE,B1<>"declined"),"health","")))

    HTH
    Steve

  7. #7
    Registered User
    Join Date
    06-12-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Need to combine several IF statements together

    Steve, you work miracles! Such a blessing. Thank you!

    Do you know how many additional IF(And(ISERROR... statements I can add to this function without getting an error message? I am just wondering how many categories I will be able to create with this.

    Thanks!

  8. #8
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094

    Re: Need to combine several IF statements together

    Hi,

    You can use up to 7 IF statements. If you have more conditions than that another method would have to be used.

    Steve

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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