Question: I am unsure what syntax issue I am having with my If/Elif statement. I want to not use a column in my calculation if the value is blank. The end goal is to not have extra spaces before, after and between values.

Please be kind. I am still learning Python for scripting in ArcGIS Desktop.

Here is my Prelogic and Expression.

Prelogic:

```
def ifFields(SubAdd,LandM, ZipN):
  if SubAdd== " ":
    return "!LandmarkName! + ' ' + '('+ !ZipName! + ')'"
  elif LandM== " ":
    return "!SubAddress! + ' ' + '('+ !ZipName!+')'"
  elif ZipN== " ":
    return "!SubAddress! + ' ' + !LandmarkName!"

```

Expression:

```
ifField(!SubAddress!, !LandmarkName!, !ZipName!)

```

Answer: 
You define the function as ifFields but call it with ifField. They need to be the same.

Also I dont think it will return what you want.

Try changing:

```
"!LandmarkName! + ' ' + '('+ !ZipName! + ')'"

```

To:

```
'{0} ({1})'.format(LandM, ZipN)

```

And the same way for the elifs. If you dont want it to return `None` if none of the conditions are met, you need to end with an else.
In addition to what was mentioned by BERA, you are also returning the field names as text, and referencing the field names, not the variable names. You code should look more like this:

```
def ifFields(SubAdd,LandM, ZipN):
  if SubAdd== " ":
    return LandM + ' ' + '('+ ZipN + ')'
  elif LandM== " ":
    return SubAdd + ' ' + '('+ ZipN+')'
  elif ZipN== " ":
    return SubAdd + ' ' + LandM

```

However this is not very nice and can cause issues when dealing with numbers. Better to use:

```
def ifFields(SubAdd,LandM, ZipN):
  if SubAdd== " ":
    return '{0} ({1})'.format(LandM, ZipN)
  elif LandM== " ":
    return '{0} ({1})'.format(SubAdd, ZipN)
  elif ZipN== " ":
    return '{0} {1}'.format(SubAdd, LandM)

```

That should do something and not error, but I am still unsure what your goal is. It might be better to use str.join on all the ones that exist, but again, I don't fully understand what your goal is here. If you have more than one thing blank this is going to get ugly. Also blanks can be None or '', so it might be good to check for those too.