+ Reply to Thread
Results 1 to 9 of 9

Problem with Multiple OR Statements in Formula

  1. #1
    Registered User
    Join Date
    04-30-2008
    Posts
    67

    Question Problem with Multiple OR Statements in Formula

    Hey All,

    I'm having issues with a formula. I've narrowed it down to the 3rd IF statement in the VLOOKUP section, specifically the OR statement.

    Here is the formula:
    Please Login or Register  to view this content.
    The problem lies with N8, which is a letter grabbed from another string. If I change this to "R" or "M", it works fine. If I use any of the other letters ("A"-"J"), it resolves to "-", which is the ISERROR resolution.

    Can someone take a look and tell me what I'm doing wrong? AFAIK, I can nest a bunch of variable in an OR statement, so I'm not sure what's wrong.

    Thanks
    Last edited by stusic; 10-04-2013 at 10:58 AM. Reason: Title Nazi

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Problem with Formula

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    04-30-2008
    Posts
    67

    Re: Problem with Formula

    Is there a term for when you find an answer immediately after you ask the question? It's almost as if the act of asking is what triggers the realization of the solution. Anyways, I figured it out; I couldn't simply put one OR statement, I had to dole out an OR statement for each possibility as such:

    Please Login or Register  to view this content.
    Thanks All,

    -stu

  4. #4
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Problem with Multiple OR Statements in Formula

    What is your req/result

    descrb your data ,then req/result

  5. #5
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Problem with Multiple OR Statements in Formula

    =if(iserror(vlookup(o8,$l$35:$p$45,if(n8="r",3,if(n8="m",4,if(or(n8="a",n8="b",n8="c",n8="d",n8="e",n8="f",n8="g",n8="h",n8="j"),5,"unknown"))))),"-",vlookup(o8,$l$35:$p$45,if(n8="r",3,if(n8="m",4,if(or(n8="a",n8="b",n8="c",n8="d",n8="e",n8="f",n8="g",n8="h",n8="j"),5,"unknown")))))
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Problem with Multiple OR Statements in Formula

    That is what i was suggesting

  7. #7
    Forum Contributor
    Join Date
    03-11-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    736

    Re: Problem with Multiple OR Statements in Formula

    No prob your issue gets resolve is imp

  8. #8
    Registered User
    Join Date
    04-30-2008
    Posts
    67

    Re: Problem with Multiple OR Statements in Formula

    Quote Originally Posted by ROHAN999 View Post
    That is what i was suggesting
    Yeah, I think we're both on the same page. Thanks for responding.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Problem with Multiple OR Statements in Formula

    the IF bit should be like this
    =IF(N9="R",3,IF(N9="M",4,IF(OR(N8={"A","B","C","D","E","F","G","H","J"}),5,"unknown")))
    but if the answer is unknown the vlookup wouldnt work as there is no such column number as unknown!also the vlookup should have FALSE at the end
    =VLOOKUP(O9,$L$35:$P$45,IF(N9="R",3,IF(N9="M",4,IF(OR(N8={"A","B","C","D","E","F","G","H","J"}),5,"unknown"))),FALSE)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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: 7
    Last Post: 02-03-2013, 06:25 PM
  2. Replies: 2
    Last Post: 01-22-2013, 07:09 AM
  3. Problem reading formula with ActiveCell.Formula
    By Matija in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2011, 06:10 AM
  4. [SOLVED] Formula Problem
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 06:05 AM
  5. Formula problem
    By Di in forum Excel General
    Replies: 1
    Last Post: 04-26-2005, 12: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