Skip to main content

CONCATENATE but exclude blank cells

  • February 1, 2019
  • 5 replies
  • 102 views

I have one field that I would like to generate from three other ones: First Name, Middle Name, and Last Name.

My current formula includes a space after each cell so that it reads Jane Doe Smith versus JaneDoeSmith.

The problem I have is if the middle name field is blank (I always have the first and last name of the person), I get a double space between the first and last name.

I’m certain there’s some sort of If/Then formula I should be using, and I’ve looked at online resources, but I’m having a hard time getting it to work (I get the invalid formula error message).

Tried this:

CONCATENATE({First Name}&IF({Middle Name}<>""," “&{Middle Name},)&IF({Last Name}<>”"," “&{Last Name},”"))

Thanks!

5 replies

Forum|alt.badge.img+5
  • Inspiring
  • 1386 replies
  • February 1, 2019

Easiest way:

{First Name}&
IF(
    {Middle Name},
    ' '&{Middle Name}
    )&
' '&
{Last Name}

  • Author
  • New Participant
  • 1 reply
  • February 1, 2019

Easiest way:

{First Name}&
IF(
    {Middle Name},
    ' '&{Middle Name}
    )&
' '&
{Last Name}

This formula worked, thank you!


Forum|alt.badge.img+17
  • Inspiring
  • 1124 replies
  • February 1, 2019

This formula worked, thank you!


Of course, because the space for Middle Name is inside the IF for that field.


Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • 4647 replies
  • April 5, 2020

Could you please share the formula that you say is failing? We can’t help you unless you give us something to work with. :winking_face:


Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • 4647 replies
  • June 26, 2020

@Carlos_Hurtado Checking once more to ask if you could share the formula that you say is failing. Unfortunately, @W_Vann_Hall hasn’t been active for a while, but there are others who could also help.