Concatenation and Nulls

Keith Nichols

Registered User.
Local time
Tomorrow, 01:42
Joined
Jan 27, 2006
Messages
431
Hi there,

Chatting with someone who used Excel a lot, I mentiond the method I use in Access to concatenate things without spaces when an item is null. For example:

Expr1: [FName] & " " & ([MName]+" ") & [LName]

The bracketed middle part of the expression will not produce anything if there is no middle name and so avoid having 2 spaces between the first and last name.

I have tried this in Excel and it doesn't work:
=A2&" "&(B2+" ")&C2 which gives a #Name error.

Is there any straightforward way to achieve the same result as I get in Access?

Regards,
 
Howdy. Try this:

=A2&" "&IF(B2<>"",B2&" "&C2,C2)
________
Honda Cn250
 
Last edited:
Is there any straightforward way to achieve the same result as I get in Access?
shades said:
Howdy. Try this:

=A2&" "&IF(B2<>"",B2&" "&C2,C2)

Pretty straightforward Shades and works a treat.

Regards,
 

Users who are viewing this thread

Back
Top Bottom