# If not equal to null (or blank) formula

This is a discussion on If not equal to null (or blank) formula within the Excel Questions forums, part of the Question Forums category; I am trying to write an formula that tests for a null value before executing the remainder of the formula. ...

1. ## If not equal to null (or blank) formula

I am trying to write an formula that tests for a null value before executing the remainder of the formula. Here is the existing formula in cell M2:

=VLOOKUP(A2,'Sheet2'!\$A\$2:\$J\$613,6,FALSE)

What I'd like is to insert an IF test for A2: If A2 is not null/blank, then perform the VLOOKUP. If A2 is null/blank, leave cell M2 blank.

2. ## Re: If not equal to null (or blank) formula

=if(a2<>"",VLOOKUP(A2,'Sheet2'!\$A\$2:\$J\$613,6,FALSE),"")

3. ## Re: If not equal to null (or blank) formula

=IF(COUNTIF('Sheet2'!\$A\$2:\$A613,A2),VLOOKUP(A2,'Sheet2'!\$A\$2:\$J\$613,6,FALSE),"")

4. ## Re: If not equal to null (or blank) formula

If(A2="","",formula)

5. ## Re: If not equal to null (or blank) formula

Thanks, Daunting. That worked. I thought I had tried the exact same formula, but I was getting errors. Obviously, something was wrong with my syntax.

Thanks everyone else for your replies, too!

6. ## Re: If not equal to null (or blank) formula

I have a question on formatting a cell based on another cell. In Excel 1007, how do I get G3 to highlight itself red if F3 contains the word Fail and G3 is left blank, and then have G3 go back to white highlight if I put a value in G3?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•