Skip to main content

IF Formula for naming a field

  • August 15, 2022
  • 6 replies
  • 39 views

Leah_Relish
Forum|alt.badge.img+9

Hello Community!

I am struggling with writing a formula for naming the main field in a table.

I would like the formula to name the field {Company} if the field {Company} is not blank and name the field {Last Name} - {First Name} if the {Company} field is blank.

I just can’t seem to get it right. Can anyone help?

Thanks!

6 replies

TheTimeSavingCo
Forum|alt.badge.img+31

Hi Leah, could you try the following?

IF(
  {Company},
  {Company},
 {Last Name} & " - " & {First Name}
)

Edit: Fixed the error kuovonne pointed out below!


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • August 16, 2022

Hi Leah, could you try the following?

IF(
  {Company},
  {Company},
 {Last Name} & " - " & {First Name}
)

Edit: Fixed the error kuovonne pointed out below!


I think you mean

{Last Name} & " - " & {First Name}

Otherwise you are trying to do math with names.


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • August 16, 2022

Formulas can set cell values. Formulas cannot change the name of a field (the column heading).


TheTimeSavingCo
Forum|alt.badge.img+31

I think you mean

{Last Name} & " - " & {First Name}

Otherwise you are trying to do math with names.


Hahahha now you’ve got me thinking about how I would deduct a first name from a last name

Thanks!


Leah_Relish
Forum|alt.badge.img+9
  • Author
  • Known Participant
  • August 18, 2022

Hi Leah, could you try the following?

IF(
  {Company},
  {Company},
 {Last Name} & " - " & {First Name}
)

Edit: Fixed the error kuovonne pointed out below!


YES! You are amazing. I was totally over complicating it.

Thank you :slightly_smiling_face:


Leah_Relish
Forum|alt.badge.img+9
  • Author
  • Known Participant
  • August 18, 2022

Hahahha now you’ve got me thinking about how I would deduct a first name from a last name

Thanks!


:rofl: too funny - and good point!