Here's one that works with negatives as well:
(setq lst2 '(-45 -23 -63 5 -8 56 74 32 -96 -144 95))
(defun closest2 (nlst / int pos)
(initget 1)
(setq int (getint "\nEnter a number: "))
(setq pos (vl-position
(apply 'min
(setq pos (mapcar 'abs (mapcar '(lambda (n) (- n int)) nlst)))
)
pos
)
)
(princ (strcat "The number closest to "
(itoa int)
" is "
(itoa (nth pos nlst))
"."
)
)
)