+ Reply to Thread
Results 1 to 4 of 4

If statement with two variables

  1. #1
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    If statement with two variables

    Hi

    I need to do an if statement if a cell (E4) = "yes" or E4= "n/a" then G4,0

    this is the precise formula I tried but its not working for any yes statements
    =if(OR(E4="yes",E4="N/a"),G4,0)

    Can anyone help
    thanks
    leanne

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

    Re: If statement with two variables

    Check that you don't have a trailing space in E4.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: If statement with two variables

    My guess would be the yes in E4 is not the exact yes in your formula. Any chance there is an extra space or anything in E4?

  4. #4
    Forum Contributor
    Join Date
    11-12-2014
    Location
    Boston, MA
    MS-Off Ver
    Office 2010
    Posts
    172

    Re: If statement with two variables

    I can only imagine all the yesses might have a space after the "s"? Try =IF(OR(LEFT(E4,3)="yes",E4="N/A"),G4,0)
    Or you can just figure out if there is a space after the s, and if there is then filter column E for only yes's, then change the top one to say only "yes" (no spaces) and copy the whole way down

+ 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. Set Variables With If Statement
    By w.m.christensen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2013, 12:10 AM
  2. [SOLVED] IF AND OR Statement with 4 variables
    By Webbers in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-24-2012, 03:03 PM
  3. IF Statement with 3 variables
    By garopro in forum Excel General
    Replies: 11
    Last Post: 09-29-2011, 12:23 PM
  4. Too many variables for an if than statement?
    By repke in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-02-2006, 12:01 PM
  5. Use variables in sql statement
    By Markantesp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2005, 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