3

For Example:

If cell A1 contains the letter "A", "B" or "C" randomly in it, and in cell B1, lookup A1 (doesn't matter where). If cell A1 DOESN'T contain the letter "A", "B" or "C" in it, I want B1 to show up blank. At the moment, the cell only shows up as #N/A when it can't find the value it's looking for.

Cell A1 would have different values in it randomly (that's why I'm using lookup A1), I need to find a way to make B1 show up blank when there are NO values in A1.

2 Answers 2

1

To suppress error messages from a command, wrap it in iferror:

=iferror(vlookup(...))

Generally, iferror may have a 2nd argument, custom error text. But if there is none, the cell is left blank in case of error.

-1

If you are looking for just the letter A and nothing else, use a simple IF statement.

=IF(A1="A","The Cell A1 Has the Letter A","")

If you are looking for a string of characters that contains the letter A at some point use RegExMatch

=IF(RegExMatch(A1,"A"),"Cell A1 Contains the letter A","")

The last part of the IF statement, on both cases, where you see "", will put nothing in the cell if the I statement fails (is false)

2
  • Cell A1 would have different values in it randomly (that's why I'm using lookup A1), I need to find a way to make B1 show up blank when there are NO values in A1. Commented Mar 20, 2016 at 11:18
  • Aside: using "" to make a cell look empty is a bad practice, because the cell will not be empty: it will contain a string of length 0. Some formulas break down in subtle ways when a sheet has such things. If you need IF to leave a cell empty, leave out one of its arguments: if(A1="A", "text", )
    – user79865
    Commented Mar 20, 2016 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.