# IF empty,null, return a value in an IF statement



## pete234 (Oct 12, 2012)

Can anyone help with this I suppose easy formula?
I am trying to return a value for scoring so I can group some data.
I want to return -10 if the Phone field is blank AND the bounce field=1.
I've tried a dozen versions of this based off the example at msdn.
I get either too few, too many or 2nd and 3rd data types do not match.
I can't even find if I'm using the correct format for blank.

=IF(AND([Bounce]=1,[Phone]="",true),"-10","0"

Anyone have any suggestions?


----------



## alansidman (Oct 12, 2012)

I'm guessing at this as I don't know your details.  Does your table have a name.  I am assuming if you have field names, then you probably have a table.  As such, I think that you need to add the table name in front of the field name.  Probably something like this

=IF(and(tablename.[Bounce]=1,tablename.[Phone]=""),-10,0)

The other thing is that the syntax is incorrect. 

syntax for IF statements are If(criteria,Results if true, results if False)

Try it with and without the tablename.


----------



## pete234 (Oct 14, 2012)

Thanks for this suggestion.  I realize I may have to evaluate phone as "not empty".  But the only thing I found is ISTEXT but this only takes one argument.
So is there a way to use Not Null with IF? My field Phone is text or empty.
Using table name did get the formula to work.


----------



## NickyvV (Oct 16, 2012)

Hi Pete,

I believe wat you need is ISBLANK().
In your formula the AND functions has 3 arguments, but it only takes 2..
I think both the formulas beneath suit your needs?


```
=IF(AND(Table[Bounce]=1,ISBLANK(Table[Phone])), -10, 0)
```


```
=IF(Table[Bounce]=1 && ISBLANK(Table[Phone]), -10, 0)
```


----------

