AutoCAD Architecture is going to evaluate the entire formula, not just the logical branch that would be evaluated for a given case. So, when [OccupancyPerSF] is set to 0, even though only the true condition would need to be evaluated, the false (Else) condition will also be evaluated, and that will result in division by 0, which causes the formula to fail.
You will want to use something like this, which makes the same test, but avoids division by zero:
Code:
If [OccupancyPerSF] = 0 Then
occPerSF = 1
Else
occPerSF = [OccupancyPerSF]
End If
If [OccupancyPerSF] = 0 Then
RESULT = [OccupancyPerEquip]
Else
RESULT = [SpaceStyles:NetArea]/occPerSF
End If
You could also choose to always have a non-zero value in [OccupancyPerSF] (make the default value 1 and instruct users never to set it to 0) and make your test based on whether OccupancyPerEquip is zero or not. If it is zero, then set the result to [SpaceStyles:NetArea]/[OccupancyPerSF], otherwise, set it to [OccupancyPerSF].
Note that the above does not apply any rounding; I would expect an occupant load calculation to always round any fractional amount up to the next whole number. The following builds on the previous, and rounds up any fractional amount when [SpaceStyles:NetArea]/[OccupancyPerSF] is calculated.
Code:
If [OccupancyPerSF] = 0 Then
occPerSF = 1
Else
occPerSF = [OccupancyPerSF]
End If
If [OccupancyPerSF] = 0 Then
RESULT = [OccupancyPerEquip]
Else
occTotal = [SpaceStyles:NetArea]/occPerSF
occTotalWhole = Fix( occTotal )
occTotalFract = occTotal - occTotalWhole
If occTotalFract > 0 Then
occTotal = occTotalWhole + 1
Else
occTotal = occTotalWhole
End If
RESULT = occTotal
End If
Also, make certain that the [SpaceStyles:NetArea] value does not have a Property Data Format that adds any text, such as a " SF" suffix. You do not have to alter the [SpaceStyles:NetArea] property itself; in your formula property, in the Sample Values area, you can specify a different format, such as Standard, that does not add text to the numeric value in a prefix or suffix.