Skip to main content
Solved

Combining fields when some are sometimes empty

  • February 21, 2021
  • 3 replies
  • 25 views

Forum|alt.badge.img+14

Grateful to those in this community who helped me set up my family’s bookstore inventory. It’s going well and I often recommend Airtable to others.

So now I’m using this formula…

Title & " • " Author & " • " Place & " • " Date

But because a number of books do NOT indicate author, place, or date, I sometimes end up with this:

Title • • • Date

That’s not great for catalogs. Is there a formula I can use that will leave off the extra bullet(s) when one or more of the fields are empty?

Best answer by ScottWorld

You can just do a simple IF() statement before each field to check if it exists.

So you can do this:

Title & IF(Author, " • " & Author) & IF(Place, " • " & Place) & IF(Date, " • " & Date)

3 replies

ScottWorld
Forum|alt.badge.img+35
  • Genius
  • Answer
  • February 21, 2021

You can just do a simple IF() statement before each field to check if it exists.

So you can do this:

Title & IF(Author, " • " & Author) & IF(Place, " • " & Place) & IF(Date, " • " & Date)


Forum|alt.badge.img+14
  • Author
  • Known Participant
  • February 22, 2021

You can just do a simple IF() statement before each field to check if it exists.

So you can do this:

Title & IF(Author, " • " & Author) & IF(Place, " • " & Place) & IF(Date, " • " & Date)


Yay! ScottWorld for the win! Thanks so much! :grinning:


ScottWorld
Forum|alt.badge.img+35
  • Genius
  • February 22, 2021

Haha, you’re welcome! Glad I could help! :slightly_smiling_face: