Share via

IFERROR + TRIM

Anonymous
2016-06-27T16:14:41+00:00

Currently useing the following formula to put together a name string ex: [LAST, FIRST MIDDLE]:

=TRIM(SUBSTITUTE([@[LAST NAME]]&", "&[@[FIRST NAME]]&" "&[@[MIDDLE NAME]],".",""))

I am trying to add an IFERROR so if the preceding cells are blank then nothing will be returned. Only problem I am having is that the comma is being returned when everything else is blank. Any idea how I can have the comma only return when their is data present vs. not returning when no data is present.

Currently using Excel 2016

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2016-06-27T17:14:03+00:00

    This totally works with one small modification:

    =IF([@[LAST NAME]]="","",TRIM(SUBSTITUTE([@[LAST NAME]]&", "&[@[FIRST NAME]]&" "&[@[MIDDLE NAME]],".","")))

    Thank you.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-06-27T16:40:33+00:00

    Hi.

    =if(LAST NAME="","",TRIM(SUBSTITUTE([@[LAST NAME]]&", "&[@[FIRST NAME]]&" "&[@[MIDDLE NAME]],".","")))

    Was this answer helpful?

    0 comments No comments