Skip to main content
Solved

Extra Lines from Formula using TRIM() and & "\\n" &

  • March 19, 2024
  • 2 replies
  • 31 views

Forum|alt.badge.img+17

I have addresses with several fields, some fields are not always necessary.

  • Member
  • Organization
  • Mail Address
  • 2nd Mail Address
  • City
  • State
  • Zipo Code

Trying to get a multi line field that has no blank lines.

Here's the formula I am using. I cannot find a way to get rid of the blank lines. What am I doing wrong?

I also included a screen shot of the existing multiline field.

Thanks in advance for any help, Scott

 

TRIM( IF( AND( Organization, {2nd Mail Address} ), Member & "\n" & Organization & "\n" & {Mail Address} & "\n" & {2nd Mail Address} & "\n" & City & ", " & State & " " & {Zip Code}, IF( AND( Organization, {2nd Mail Address} = BLANK() ), Member & "\n" & Organization & "\n" & {Mail Address} & "\n" & City & ", " & State & " " & {Zip Code}, IF( Organization = BLANK(), Member & "\n" & {Mail Address} & "\n" & {2nd Mail Address} & "\n" & City & ", " & State & " " & {Zip Code}, IF( AND( Organization = BLANK(), {2nd Mail Address} = BLANK() ), Member & "\n" & {Mail Address} & "\n" & City & ", " & State & " " & {Zip Code} )))))

 

Best answer by pressGO_design

Instead of trying to address every permutation of data, you can create IF statements for each option with the “/n”+field when it’s true. Everyone has a name, a city, state, and zip code, so 

Trim(
Member&
IF(Organization, “/n”&Organization)&
IF(mailAddress, “/n”&mailAddress)&
IF(2ndMailAddress, “/n”&2ndMailAddress)&
”/n”&City&”, “&State&” “&Zip
)

2 replies

pressGO_design
Forum|alt.badge.img+21

Instead of trying to address every permutation of data, you can create IF statements for each option with the “/n”+field when it’s true. Everyone has a name, a city, state, and zip code, so 

Trim(
Member&
IF(Organization, “/n”&Organization)&
IF(mailAddress, “/n”&mailAddress)&
IF(2ndMailAddress, “/n”&2ndMailAddress)&
”/n”&City&”, “&State&” “&Zip
)


Forum|alt.badge.img+17
  • Author
  • Inspiring
  • March 19, 2024

Wow, thank you pressGO_design. I sometimes get too literal and too verbose when writing formulas.  Really appreciate the help. I will store this away for the future too. Best, Scott