+ Reply to Thread
Results 1 to 5 of 5

IF OR Statement

  1. #1
    Registered User
    Join Date
    10-14-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    98

    IF OR Statement

    Hello everyone,

    I am trying to write a formula in excel with the following:

    IF(OR(F17,F18,F19)="YES",....,.....)

    I discovered that I should write the following instead:

    IF(OR(F17="YES",F18="YES",...,...,...)

    I was wondering if there was any other quick way to write this formula as I have more than 200 rows and it might get my formula very slow.

    Thank you

  2. #2
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Quebec, Canada
    MS-Off Ver
    2013
    Posts
    232

    Re: IF OR Statement

    Do you mean that you are planning to use this formula in more than 200 rows, of that you want to check if over 200 different cells if they are equal to yes?

    If you only have a few cells like in your example, having
    IF(OR(F17="YES",F18="YES",F19="YES"),...,...)
    won't be an issue if you only have "more than 200 rows", that should be fine. However, if you are planning to put a ton of cells like that, then you might wanna do something else instead. Using a helper column or something from your file might help, you may want to post a workbook in that case.

  3. #3
    Registered User
    Join Date
    10-14-2014
    Location
    USA
    MS-Off Ver
    2010
    Posts
    98

    Re: IF OR Statement

    What can I use instead?

    If i have many rows and I want the file to work smoothly.

  4. #4
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Quebec, Canada
    MS-Off Ver
    2013
    Posts
    232

    Re: IF OR Statement

    Well it really depends on what your file looks like, what you can do and what you're actually trying to do.

    If, for example, you have a column with 500 values that can have anything in them, and want your formula to give you "Yes" if any of those cells contain a "Yes", then you could use VLOOKUP. Something like:
    =IF(ISERROR(VLOOKUP("YES",F17:F500,1,FALSE)),[thing to do if there's not a yes],[thing to do is there's a yes])

  5. #5
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: IF OR Statement

    If all you want to do is check if a cell in a range (one or more) equals 'Yes', then try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If 'Yes' might be contained in a longer string (e.g. '2 - Yes') then use this instead:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Hope that helps.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

+ 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. [SOLVED] i have an if then statement that works, how to make it work as a with or case statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2016, 03:34 PM
  2. Replies: 2
    Last Post: 07-09-2015, 04:25 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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