if and isblank function

  • Thread starter Thread starter Dominique Feteau
  • Start date Start date
D

Dominique Feteau

Heres is my function:

=IF(ISBLANK(L16),"","Cc: "&L16&" "&M16)

What i want to do is put L16 & M16 together with the "Cc: " in front of it.
But I want the cell blank if nothing is in L16.

When I use this code, it puts the "Cc: " in there. How do i change it up
so that it remains blank and the "Cc: " only comes up when L16 & M16 are
populated.
 
Hi Dominique!

Try:

=IF(OR(ISBLANK(L16),ISBLANK(M16)),"","Cc "&L16&" "&M16)

If either L16 or M16 is blank then it returns ""


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
=IF(OR(ISBLANK(L16),ISBLANK(M16)),"","Cc "&L16&" "&M16)
...

Three function calls for adjacent cells is wasteful. Especially for this.

=IF(COUNT(L16:M16),TRIM("Cc "&L16&" "&M16,"")
 
Hi Harlan!

Agreed the Oops! COUNTA forgot I existed yesterday.

Happy New Year

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
Harlan Grove said:
...
..

OOPS! Make that

=IF(COUNTA(L16:M16),TRIM("Cc "&L16&" "&M16,"")


--
Never attach files.
Snip unnecessary quoted text.
Never multipost (though crossposting is usually OK).
Don't change subject lines because it corrupts Google newsgroup
archives.
 
Back
Top