(defun c:Ave( / ss n i sname data ave)
(setq ss (ssget '((0 . "text,mtext"))))
(setq n (sslength ss))
(setq i 0)
(while (< i n)
(setq sname (ssname ss i))
(setq data (append data (list (atof (getext sname)))))
(setq i (1+ i))
)
(setq ave (apply '+ data))
(setq ave (/ ave n))
(princ ave)
(princ)
)