+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : if cell equals text or text, then...

  1. #1
    Registered User
    Join Date
    02-25-2010
    Location
    somewhere
    MS-Off Ver
    Excel 2003
    Posts
    2

    if cell equals text or text, then...

    Hello, I'm trying to make a formula in excel 2007, where if for instance A1 equals "x" or is empty, then B2 would display "N/A", otherwise it would display "missing".
    So if the cells in column A contain either x or are completely empty, the corresponding cells in column B would show N/A. if the cells in column A contain anything else, the corresponding cells in B would display "missing".
    this is what I tried so far:
    =IF(OR(A1="x", A1=""), "N/A", "missing")
    I also thought maybe apostrophes are needed instead of quotes, I never know which to use and when:
    =IF(OR(A1='x', A1=''), 'N/A', 'missing')

    thanks a lot in advance!

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: if cell equals text or text, then...

    =IF(OR(A1="x",LEN(A1)=0),"N/A","Missing")

    I also thought maybe apostrophes are needed instead of quotes, I never know which to use
    Quotes are required whenever you need to return a text string and not the result of cell or calculation
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    02-25-2010
    Location
    somewhere
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: if cell equals text or text, then...

    It says the formula you typed contains and error, and it highlights the ""x",LEN(" section of the it...
    am i doing something wrong?

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: if cell equals text or text, then...

    It seems that both the first formula you had and Palmetto's offering should work. Without seeing the worksheet (which would help, if you can post it with dummy data), my first question is whether the value in A1 comes from a database or other program. In such cases, those cells will often have spaces in them. When you do =Len(A1) in another cell, with A1 looking like it's blank, what result do you get?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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