The question you linked to, Lisp format directive that interprets nil argument to empty string instead of "NIL", does include an answer that shows how you can do this, but doesn't cite any of the documentation. Since you're generating English text, there are also a few other options that you might want to consider as well.
First, with ~@[consequent~], you can process the consequent format directive just in the case that the argument is non-nil, and the argument to ~@[ isn't consumed, so it's still available. In general,
22.3.7.2 Tilde Left-Bracket: Conditional Expression describes lots of options, but about ~@[ it says:
~@[consequent~] tests the argument. If it is true, then the argument
is not used up by the ~[ command but remains as the next one to be
processed, and the one clause consequent is processed. If the arg is
false, then the argument is used up, and the clause is not processed.
The clause therefore should normally use exactly one argument, and may
expect it to be non-nil.
You can use this as follows:
(defun test (day name n-apples)
(format nil "Today is ~a. Hello~@[ ~a~], you have ~a apples."
day name n-apples))
CL-USER> (test 'monday 'adam 2)
"Today is MONDAY. Hello ADAM, you have 2 apples."
CL-USER> (test 'tuesday nil 42)
"Today is TUESDAY. Hello, you have 42 apples."
To make this even more robust, you should consider using ~p for pluralization, so that you get "1 apple" and "3 apples".
(defun test (day name n-apples)
(format nil "Today is ~a. Hello~@[ ~a~], you have ~a apple~:P."
day name n-apples))
CL-USER> (test 'monday 'john 2)
"Today is MONDAY. Hello JOHN, you have 2 apples."
CL-USER> (test 'tuesday 'john 1)
"Today is TUESDAY. Hello JOHN, you have 1 apple."
CL-USER> (test 'wednesday nil 0)
"Today is WEDNESDAY. Hello, you have 0 apples."
Finally, since you're generating text, you might appreciate some case normalization (e.g., print proper nouns with initial capitals), and writing the numbers in text:
(defun test (day name n-apples)
(format nil "Today is ~:(~a~). Hello~@[ ~:(~a~)~], you have ~r apple~:P."
day name n-apples))
CL-USER> (list
(test 'monday 'adam 4)
(test 'tuesday 'john 1)
(test 'wednesday 'mary\ sue 42)
(test 'thursday 'jim-bob 0))
("Today is Monday. Hello Adam, you have four apples."
"Today is Tuesday. Hello John, you have one apple."
"Today is Wednesday. Hello Mary Sue, you have forty-two apples."
"Today is Thursday. Hello Jim-Bob, you have zero apples.")