Skip to main content
Solved

IF formula to remove space if no data

  • November 24, 2020
  • 2 replies
  • 16 views

jord8on
Forum|alt.badge.img+16

I’m not sure the best way to ask this question, but here goes!

I have the following formula…

Model & " " & VAR_Color & " " & VAR_Type & " " & VAR_Weight_Name & " " & VAR_GRIP_Circumference

Some of my “Models” are missing one or several of the VAR (fields) and when that happens I’m left with a double or even triple space.

I want to concatenate the formula in such a way that IF a field/VAR is empty that the VAR and the space in front of it are omitted, but if a VAR exists, then the VAR and the space in front of it are displayed.

Thanks in advance for any advice on how to revise/simplify this formula!

Best answer by kuovonne

Model & 
IF( VAR_Color, " " & VAR_Color) & 
IF( VAR_Type, " " & VAR_Type) & 
IF( VAR_Weight_Name, " " & VAR_Weight_Name) & 
IF( VAR_GRIP_Circumference, " " & VAR_GRIP_Circumference)

2 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • Answer
  • November 24, 2020
Model & 
IF( VAR_Color, " " & VAR_Color) & 
IF( VAR_Type, " " & VAR_Type) & 
IF( VAR_Weight_Name, " " & VAR_Weight_Name) & 
IF( VAR_GRIP_Circumference, " " & VAR_GRIP_Circumference)

jord8on
Forum|alt.badge.img+16
  • Author
  • Inspiring
  • November 24, 2020
Model & 
IF( VAR_Color, " " & VAR_Color) & 
IF( VAR_Type, " " & VAR_Type) & 
IF( VAR_Weight_Name, " " & VAR_Weight_Name) & 
IF( VAR_GRIP_Circumference, " " & VAR_GRIP_Circumference)

YES YES YES!!! This is exactly what I needed. What a clean formula! Thank you for the help @kuovonne!!