Skip to main content
Solved

IF not equal to paperback or hardcover, then miscellaneous

  • September 15, 2020
  • 6 replies
  • 59 views

Forum|alt.badge.img+14

Hi AirTable Geniuses!

I’m fairly new at this, but I’m hoping I could create a formula field that auto-generates an Amazon-friendly cell for each book record my old Homebase book inventory. Homebase allows for an infinite number of book binding descriptors, but the only ones on Amazon that work for my books are Hardcover, Paperback, and Miscellaneous. So my AirTable has two binding fields: HOMEBASE BINDING and AMAZON BINDING. The first will just be copied from my old database. I think the second, though, needs a formula that starts like this:

IF({HOMEBASE BINDING}=“Hardcover”,“Hardcover”,IF({HOMEBASE BINDING}=“Paperback”,“Paperback”,IF({HB BINDING}!=

This is where I get stuck. How can I tell my AirTable table that if HOMEBASE BINDING does not equal either “Hardcover” or “Paperback”, my AMAZON BINDING field should say “Miscellaneous”?

I’d be mighty grateful for some assistance with this one! It would mean not having to comb through 25,000 records. :slightly_smiling_face:

Best answer by Jeremy_Oglesby

Hi @Alba_Machado2,

Since you are only checking the value of one field over and over again here, you’ll find it much easier to make use of the SWITCH() function instead. The SWITCH() function lets you set a default value if none of the other matches are hits:

SWITCH(
   {HOMEBASE BINDING},
   "Hardcover", "Hardcover",
   "Paperback", "Paperback",
   "Miscellaneous"
)

6 replies

JonathanBowen
Forum|alt.badge.img+18
  • Inspiring
  • September 15, 2020

Hi @Alba_Machado2 - you can just do this:

IF( {HOMEBASE BINDING} = 'Hardcover', 'Hardcover', IF( {HOMEBASE BINDING} = 'Paperback', 'Paperback', 'Miscellaneous' ) )

The final option is shown if it is neither hardback or paperback


Forum|alt.badge.img+18
  • Inspiring
  • Answer
  • September 15, 2020

Hi @Alba_Machado2,

Since you are only checking the value of one field over and over again here, you’ll find it much easier to make use of the SWITCH() function instead. The SWITCH() function lets you set a default value if none of the other matches are hits:

SWITCH(
   {HOMEBASE BINDING},
   "Hardcover", "Hardcover",
   "Paperback", "Paperback",
   "Miscellaneous"
)


Forum|alt.badge.img+18

Oops… sorry @JonathanBowen. Your response didn’t show until I hit reply and my page updated.


JonathanBowen
Forum|alt.badge.img+18
  • Inspiring
  • September 15, 2020

Hi @Alba_Machado2,

Since you are only checking the value of one field over and over again here, you’ll find it much easier to make use of the SWITCH() function instead. The SWITCH() function lets you set a default value if none of the other matches are hits:

SWITCH(
   {HOMEBASE BINDING},
   "Hardcover", "Hardcover",
   "Paperback", "Paperback",
   "Miscellaneous"
)


Yep, SWITCH probably better


JonathanBowen
Forum|alt.badge.img+18
  • Inspiring
  • September 15, 2020

Oops… sorry @JonathanBowen. Your response didn’t show until I hit reply and my page updated.


No problem :slightly_smiling_face: Think yours is the better solution!


Forum|alt.badge.img+14
  • Author
  • Known Participant
  • September 15, 2020

Hi @Alba_Machado2 - you can just do this:

IF( {HOMEBASE BINDING} = 'Hardcover', 'Hardcover', IF( {HOMEBASE BINDING} = 'Paperback', 'Paperback', 'Miscellaneous' ) )

The final option is shown if it is neither hardback or paperback


Perfect! Thanks so much, Jeremy and Jonathan! (Just realized there were two of you!) :green_heart: