+ Reply to Thread
Results 1 to 18 of 18

Need Help with Complicated IF Statement with Many Variables

  1. #1
    Registered User
    Join Date
    03-12-2014
    Location
    Florida
    MS-Off Ver
    Excel - Google Docs
    Posts
    7

    Question Need Help with Complicated IF Statement with Many Variables

    This is a complicated thing I'm trying to accomplish and I only have a rudimentary grasp of Excel formulas and logical statements, so your help would be greatly appreciated!

    I need to check BE2 if it's blank. If it's not blank, leave it alone. If it is blank, I need to check S2. If S2 contains the name of 1 of 11 counties (ex.: "Marion","Pinellas","Orange","Osceola", etc.), I need BE2 to say "TBD". If it does not say one of those 11 counties, it needs to say "N/A".

    Can this even be done? If so, could someone PLEASE write an example?

    Thank you!
    Last edited by loriahein; 03-13-2014 at 08:23 AM.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Can this logical formula be done?

    Try this

    =IF(BE2="","",IF(OR(S2={"Marion","Pinellas","Orange","Osceola","etc"}),"TBD","N/A"))

    add some more county names
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    12-16-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Can this logical formula be done?

    The other way... maybe the long way is to use if functions

    =IF(ISBLANK(C2),IF(K2="Marion","TBD", IF(K2="Pinellas","TDA",IF(K2="Orange","TDA","n/A"))),C2)

    http://www.easyexcelanswers.com

  4. #4
    Forum Contributor
    Join Date
    12-16-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Can this logical formula be done?

    I have detailed explanation of if statements

    http://easyexcelanswers.com/func_for...#IF Statements

  5. #5
    Registered User
    Join Date
    03-12-2014
    Location
    Florida
    MS-Off Ver
    Excel - Google Docs
    Posts
    7

    Re: Can this logical formula be done?

    Quote Originally Posted by AlKey View Post
    Try this

    =IF(BE2="","",IF(OR(S2={"Marion","Pinellas","Orange","Osceola","etc"}),"TBD","N/A"))

    add some more county names

    Thanks! It gave me an error message, though: "Circular dependency detected." Any thoughts?

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Can this logical formula be done?

    There should not be any Circular dependency unless you entered formula in BE2

  7. #7
    Registered User
    Join Date
    03-12-2014
    Location
    Florida
    MS-Off Ver
    Excel - Google Docs
    Posts
    7

    Re: Can this logical formula be done?

    Quote Originally Posted by AlKey View Post
    There should not be any Circular dependency unless you entered formula in BE2
    Yes, I'm sorry, I should have said... BE2 is where it needs to be
    enterred.

  8. #8
    Registered User
    Join Date
    03-12-2014
    Location
    Florida
    MS-Off Ver
    Excel - Google Docs
    Posts
    7

    Re: Can this logical formula be done?

    This is what I entered, exactly: =IF(OR(S2={"Marion","Pinellas","Orange","Osceola","Hillsborough","Lake","Palm Beach","Polk","Seminole","Sumter","Pasco"}),"TBD","N/A")

    S2 is "Pasco" in this case, but what is returning is "N/A" and not "TBD"...? I even tried putting different county names in S2, both in the array and not, and it always returns N/A...?

  9. #9
    Forum Contributor
    Join Date
    12-16-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Need Help with Complicated IF Statement with Many Variables

    {"Marion","Pinellas","Orange","Osceola","Hillsborough","Lake","Palm Beach","Polk","Seminole","Sumter","Pasco"}


    You realize the curly brackets around these values indicate that it is an array.

    To get them you must press ctrl - shift - enter, you are not able to key them in yourself

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need Help with Complicated IF Statement with Many Variables

    Your formula is fine as written (for Excel, anyway), and can be confirmed in the normal way. S2 must not contain any spurious characters, like a trailing space.

    Also, (sorry), make sure you're entering the value into the right cell.
    Last edited by shg; 03-13-2014 at 04:10 PM.
    Entia non sunt multiplicanda sine necessitate

  11. #11
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Help with Complicated IF Statement with Many Variables

    @easyexcelanswers

    Please note that curly brackets do not always define a formula as an array. They are also used to accommodate multiple criteria in regular formulas and therefore do not require Ctrl+Shift+Enter key confirmation.

    @loriahein

    Please see attached Excel file with formula.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-12-2014
    Location
    Florida
    MS-Off Ver
    Excel - Google Docs
    Posts
    7

    Re: Need Help with Complicated IF Statement with Many Variables

    I copied your formula and pasted it where it needs to go, hit enter, and it still says N/A even though S2 is Pasco, which is in the list. I don't understand what I'm doing wrong? Sorry, extreme newbie here!

  13. #13
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Help with Complicated IF Statement with Many Variables

    Quote Originally Posted by loriahein View Post
    I copied your formula and pasted it where it needs to go, hit enter, and it still says N/A even though S2 is Pasco, which is in the list. I don't understand what I'm doing wrong? Sorry, extreme newbie here!
    Could you upload your spreadsheet? I suspect the problem is with your data. Make sure there are no leading or trailing spaces in S2 or at the source where the data is coming from. BTW, you have to use Excel not Google Docs.

  14. #14
    Registered User
    Join Date
    03-12-2014
    Location
    Florida
    MS-Off Ver
    Excel - Google Docs
    Posts
    7

    Re: Need Help with Complicated IF Statement with Many Variables

    Quote Originally Posted by AlKey View Post
    Could you upload your spreadsheet? I suspect the problem is with your data. Make sure there are no leading or trailing spaces in S2 or at the source where the data is coming from. BTW, you have to use Excel not Google Docs.
    Oh, drat. This is for my work and the spreadsheet has to be on Google Docs, so it looks like it won't work.

    Thank you so much for all your help. If we ever migrate over to regular Excel, I'll definitely use that formula.

  15. #15
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Help with Complicated IF Statement with Many Variables

    I've never used Google docs for spreadsheet. But I am gonna try it and see what can be done.

  16. #16
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Help with Complicated IF Statement with Many Variables

    See if you can do this by creating a lookup table in Google Docs:

    Then use this formula. I did test it in Google Docs spreadsheet and it worked fine.

    =IF(ISNA(VLOOKUP(S2,T2:T12,1,0)),"N/A","TBD")

    Q
    R
    S
    T
    U
    1
    Result County Lookup table
    2
    TBD Orange Marion
    3
    Pinellas
    4
    Orange
    5
    Osceola
    6
    Hillsborough
    7
    Lake
    8
    Palm Beach
    9
    Polk
    10
    Seminole
    11
    Sumter
    12
    Pasco

  17. #17
    Registered User
    Join Date
    03-12-2014
    Location
    Florida
    MS-Off Ver
    Excel - Google Docs
    Posts
    7

    Thumbs up Re: Need Help with Complicated IF Statement with Many Variables

    Quote Originally Posted by AlKey View Post
    See if you can do this by creating a lookup table in Google Docs:

    Then use this formula. I did test it in Google Docs spreadsheet and it worked fine.

    =IF(ISNA(VLOOKUP(S2,T2:T12,1,0)),"N/A","TBD")

    Q
    R
    S
    T
    U
    1
    Result County Lookup table
    2
    TBD Orange Marion
    3
    Pinellas
    4
    Orange
    5
    Osceola
    6
    Hillsborough
    7
    Lake
    8
    Palm Beach
    9
    Polk
    10
    Seminole
    11
    Sumter
    12
    Pasco

    YOU are AWESOME!

    I ought to give you a percentage of the raise my boss is gonna to give me for getting this worked out - THANK YOU!

  18. #18
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Help with Complicated IF Statement with Many Variables

    You're welcome!

    Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

+ 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. Formula help - Logical ?
    By JayReina in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 01:26 PM
  2. Logical formula
    By harignz in forum Excel General
    Replies: 6
    Last Post: 03-05-2012, 09:16 AM
  3. Logical Formula
    By Autumnattic in forum Excel General
    Replies: 3
    Last Post: 10-19-2011, 09:31 AM
  4. logical formula
    By Blake 7 in forum Excel General
    Replies: 4
    Last Post: 12-13-2010, 07:56 PM
  5. Logical Formula
    By weintz1 in forum Excel General
    Replies: 2
    Last Post: 09-18-2007, 12:34 PM

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