Skip to main content

Hi, I’m looking for a formula that will flag when a name is appearing in different columns in the same row. This is to flag scheduling conflicts.

 

Column A, Column B, Column C, Column D

Participant X, Participant X, Participant Y, Participant Z

 

Here is my current formula for 2 columns:

IF(AND({Column A} != "", {Column A} = {Column B}),"Duplicate")

It works. But when I try to add more columns, it breaks down. Can anyone help? Or is there another method altogether?

This would be easier to accomplish if you restructured your database so that all of your contacts were moved into one unified linked record field, because then all of your contacts would be separate records in another table. 

Then, you could create 2 rollup fields — one rollup field would show you ALL of your linked contacts, and the other rollup field would show you ONLY YOUR UNIQUE linked contacts.

If the 2 rollup fields are a mismatch, then you have duplicates. (You could create a formula that compares the 2 rollup fields.)

However, if you need to keep these contacts in 4 separate fields, you would need to create a lengthy formula that looked something like this:

IF(
OR(
{Column A}={Column B},
{Column A}={Column C},
{Column A}={Column D},
{Column B}={Column C},
{Column B}={Column D},
{Column C}={Column D}
),
“Duplicate”
​​​​​​​)

Note that this formula will only work if you have names filled in for all 4 columns, so you may need to expand upon this formula to deal with situations where 1 or more of the columns might be blank.

Hope this helps to point you in the right direction!

If you’d like to hire the best Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld


The formula just needs to be updated to contemplate the cases when the cells are empty. For examle y Column C and Column D are empty, we don’t want the result to be “Duplicate”.


  Hmm, assuming you only have the 4 columns, does this look right?

IF(
OR(
AND({Column A} = {Column B}, {Column A} != ""),
AND({Column A} = {Column C}, {Column A} != ""),
AND({Column A} = {Column D}, {Column A} != ""),
AND({Column B} = {Column C}, {Column B} != ""),
AND({Column B} = {Column D}, {Column B} != ""),
AND({Column C} = {Column D}, {Column C} != "")
),
"Duplicate"
)


I’m curious how your data gets populated though!  Are you using a form or something?


This would be easier to accomplish if you restructured your database so that all of your contacts were moved into one unified linked record field, because then all of your contacts would be separate records in another table. 

Then, you could create 2 rollup fields — one rollup field would show you ALL of your linked contacts, and the other rollup field would show you ONLY YOUR UNIQUE linked contacts.

If the 2 rollup fields are a mismatch, then you have duplicates. (You could create a formula that compares the 2 rollup fields.)

However, if you need to keep these contacts in 4 separate fields, you would need to create a lengthy formula that looked something like this:

IF(
OR(
{Column A}={Column B},
{Column A}={Column C},
{Column A}={Column D},
{Column B}={Column C},
{Column B}={Column D},
{Column C}={Column D}
),
“Duplicate”
​​​​​​​)

Note that this formula will only work if you have names filled in for all 4 columns, so you may need to expand upon this formula to deal with situations where 1 or more of the columns might be blank.

Hope this helps to point you in the right direction!

If you’d like to hire the best Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld

Thanks for the advice! I’m fairly new to databases, and the Rollup function is something I haven’t wrap my brain around yet. 


  Hmm, assuming you only have the 4 columns, does this look right?

IF(
OR(
AND({Column A} = {Column B}, {Column A} != ""),
AND({Column A} = {Column C}, {Column A} != ""),
AND({Column A} = {Column D}, {Column A} != ""),
AND({Column B} = {Column C}, {Column B} != ""),
AND({Column B} = {Column D}, {Column B} != ""),
AND({Column C} = {Column D}, {Column C} != "")
),
"Duplicate"
)


I’m curious how your data gets populated though!  Are you using a form or something?

This worked, thank you so much! I was trying to do too much in one line. 

 

AND {Column A} = {Column B},{Column C},{Column D}, etc.

 

My data comes from another table that lists all the participants to our event. This table  is to set up meetings between mentors (who each have their own column) and participants. We just need to make sure we are not double-booking the participants.

 

Let me know if there is a different, simpler method. I’m new to databases and my brain is still in “Spreadsheet” mode :-)


That’s correct… as I mentioned above, this is not the ideal way to setup a database system.

Whenever you find yourself repeating something in a database (such as multiple participants for an event), you will want to move those items to their own table.

So you would want to keep track of all your participants in their own table, and then from the events table, you would use a linked record field to link to the participants for each event.

Then, as I described in my previous post above, you could use rollup fields to determine if there are duplicates.

You also gain the flexibility to use other methods too, such as Airtable’s DeDupe extension.

Since you’re new to Airtable, you might benefit from taking my free Airtable training course, which you can take for free by signing up for a free 30-day trial with LinkedIn Learning.

The course is relatively outdated at this point because it was created 5 years ago, but the core concepts of database design, multiple tables, linking records, and linked record fields all remain the same today.

Hope this helps!

If you’d like to hire the best Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld


Ah interesting!  So each record is a timeslot?  Does each participant have to meet every mentor or something?  If you could provide a screenshot of your tables with some dummy data that’d be really helpful!

 

Assuming each record’s a timeslot I reckon I’d just do it the way you’re doing it now, really.  The only other way I could imagine handling this is really complicated, with a table where each record represents a timeslot and another table where each record represents a mentor and a timeslot, then you’d link the participants to the mentor timeslot record

If your only task right now is to just match people up, your way is fine, and you can massage the data again into a structured format after you’re done so that you can do stuff to it (e.g. send a participant an email for a specific mentor time slot you’ve scheduled them for)