title: One line VBA statement expression with If-else condition
body: <p>I am creating an VBA-like expression.</p>
  
  <pre><code>Replace([EmailAddress], "@domain.com", , , "", , )
  </code></pre>
  
  <p><code>[EmailAddress]</code> is actually consist of a string, for example "john.doe@domain.com". So the result generated from the expression will be "john.doe"</p>
  
  <p>I would like to set a condition where, if the result returned from the expression is more than 20 characters, the result return will be "john.d".</p>
  
  <p>Basically remove all the characters behind the first character after the symbol "."</p>
  
  <p>The idea is something like:</p>
  
  <pre><code>Variable a = Replace([EmailAddress], "@domain.com", , , "", , )
  
  If len(a) &gt; 20 then
    an expression that remove all the characters after the symbol "."         and first letter
  
  else
    a
  
  End if
  </code></pre>
  
  <p>I am not sure if I am making sense, as I am not a programmer and not sure if these VBA syntax used are correct. I think there should be a single line expression to accommodate all these conditions. </p>
  
  <p>Really appreciate if someone can help to guide me. </p>