Try this:
Compute the deadline in a spreadsheet a.k.a table.
#+NAME: mytbl
| # | [2014-12-14 Sun] | 30 | <2015-01-13 Tue> |
| # | [2014-12-15 Mon] | 10 | <2014-12-25 Thu> |
#+TBLFM: $4=$2+$3;D
Create a new 1x1 table that references computed deadline from first table using remote(NAME-OR-ID,REF)
function.
#+NAME: mydeadline
| <2015-01-13 Tue> |
#+TBLFM: $1=remote(mytbl,@1$4)
Pass 1x1 deadline table as variable via header :var name=value
to named SRC
block, e.g. set_deadline elisp code block below.
#+NAME: set_deadline
#+HEADER: :var the_date=mydeadline
#+HEADER: :results raw replace output
#+begin_src elisp
(princ (format "DEADLINE: %s" ( car (car the_date))))
#+end_src
Evaluate the SRC block using C-c C-c and the deadline will be added to the org-mode file under a #+RESULTS:
block.
Adding the :results raw
header to code block forces the output into format org-mode will recognize as regular org statement.
#+RESULTS: set_deadline
DEADLINE: <2015-01-13 Tue>
As an added bonus, using a named src blocks also encourages code reuse via inline function calls.
As before, evaluate each inline function using C-c C-c and a new deadline will be added to the org-mode file.
#+NAME: first-deadline
call_set_deadline(the_date=mydeadline)[ :results raw ]
#+RESULTS: first-deadline
DEADLINE: <2015-01-13 Tue>
#+NAME: my-other-deadline
| <2014-12-25 Thu> |
#+TBLFM: $1=remote(mytbl,@2$4)
#+NAME: second-deadline
call_set_deadline(the_date=my-other-deadline)[ :results raw ]
#+RESULTS: second-deadline
DEADLINE: <2014-12-25 Thu>
Hope that helped!
Note: This code was tested using the following versions of emacs and org-mode.
GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.14)
Org-mode version 8.2.10 (8.2.10-29-g89a0ac-elpa)