+ Reply to Thread
Results 1 to 3 of 3

Simple IF function with blank option

  1. #1
    Registered User
    Join Date
    06-17-2021
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    2

    Post Simple IF function with blank option

    Hello,
    I'm trying to create a simple IF function in which:
    I compare cell A1 to a known value in cell B1, if their text is the same then I get true value of "OK" and if they are not then I get a false value of "ERROR". (eg if B1 has value of "5" and I type in A1 "5" I get OK, and if I type in A1 "3" I get ERROR), Here is the function:
    =IF(A1=B1, "OK", "ERROR")
    Now the problem is that before I type something in cell A it already shows ERR0R because A is blank and B is not and they are not equal. I want the same function but when A is empty it will not show ERROR but just remain blank.

    Thank you
    Last edited by mithmith2; 06-17-2021 at 03:24 AM.

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Simple IF function with blank option

    =if(A1<>"",IF(A1=B1, "OK", "ERROR"),"")
    Try above formula
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    06-17-2021
    Location
    Portugal
    MS-Off Ver
    2013
    Posts
    2

    Re: Simple IF function with blank option

    Thank you very much! Works perfectly!

+ 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] help on a simple if text says this input that, if cell is blank leave it blank
    By Rec1ne in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-02-2013, 10:43 AM
  2. [SOLVED] Simple pull exact text from cell, if blank it pulls up a 0. How to leave it as blank?
    By sharpmel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-30-2012, 02:20 PM
  3. Showing #DIV/0! as blank in simple function
    By nickelcell1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-31-2011, 06:15 PM
  4. User option to add blank cells
    By EGR2317 in forum Excel General
    Replies: 10
    Last Post: 06-01-2010, 10:54 AM
  5. Removing option of BLANK from autofilter
    By xlman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2010, 01:15 AM
  6. Want to add a third option for =IF formula for "blank" option?
    By Pablo_Candano in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-03-2007, 12:49 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