title: Use existing spreadsheet formulas in a custom formula in google docs/spreadsheets
body: <p>I like writing my own formulas inside of Google Docs Spreadsheets. But often what I want to do is very similar to <strong>a function that already exists</strong>. As an example, I couldn't find a function to turn a date (31-Aug-2010) into the lexical day of the week (Tuesday). I'd like to write:</p>
  
  <pre><code>=LexWeekDay('31-Aug-2010')
  'Tuesday'
  </code></pre>
  
  <p>Clearly I can write all of this logic using core javascript, but there already exists a <em>normal</em> spreadsheet function called <code>WEEKDAY()</code> which <a href="http://docs.google.com/support/bin/answer.py?hl=en&amp;answer=155115" rel="nofollow noreferrer">takes a date and converts into into a number representing the day of the week</a> <code>[0 =&gt; Sunday, 1=&gt; Monday, etc]</code>.</p>
  
  <p><strong>How can I access this function (or generally any function), that speadsheets already define, from my custom script?</strong></p>