Mar 30, 2022 12:06 PM
I have a base used for tracking waiting lists for multiple events. A simplified version of the base for purposes of this question is here. Each record is one person’s entry on a waiting list for a specific event. Each record has a Status that starts out as “Waitlisted”, and then we change the Status to other values as we clear people from the waiting list for an event.
We normally use a view that groups the records first by Event Name and then by Status, with records sorted by the Created date/time. This is the first view shown in the demo base. We take people off the waiting list for an event in the order that they signed up for the waiting list.
We often have people ask us, “what number am I on the waiting list for X event?” Rather than having to manually count rows (which could be 100 or more) to answer this question, I want to have a field that shows each person’s sequential position on each event’s waiting list, based on the Created date/time. The mocked-up field called “Position on Waiting List” illustrates this, but I need a formula that will dynamically calculate that number, and then recalculate it each time we change someone’s status from “Waitlisted” to something else. The field can be blank if the status is other than “Waitlisted”.
Here’s an example. Let’s say the waiting list looks like this:
We then register John Doe for Event 1, so his Status changes to Registered. When that happens, everyone else moves up one spot on the list, so the Position on Waiting List should recalculate like this:
Any ideas on how to write that formula? Thanks in advance.
Solved! Go to Solution.
Mar 30, 2022 09:50 PM
Thanks for the hint. Using that and this post, which you also answered, I came up with a solution that works, as shown in my example base:
IF(Status="Waitlisted",1+(SEARCH({ID},ARRAYJOIN({All IDs}))-1)/(LEN({ID})+1),BLANK())
So, it works, but it sure seems like there might be an easier way. Can this be simplified somehow?
Mar 30, 2022 12:15 PM
Mar 30, 2022 12:51 PM
Welcome to the Airtable community!
It looks like you are managing everything in one table.
If you use a multi-table system with linked records, this is possible with formula fields and rollups. The rollups might take a while to re-calculate if you have a lot of linked records, but they would recalculate automatically with no scripting, no automations, and no third party tools.
If you are interested in having me guide you through setting up this system, you can book a meeting with me.
Mar 30, 2022 09:50 PM
Thanks for the hint. Using that and this post, which you also answered, I came up with a solution that works, as shown in my example base:
IF(Status="Waitlisted",1+(SEARCH({ID},ARRAYJOIN({All IDs}))-1)/(LEN({ID})+1),BLANK())
So, it works, but it sure seems like there might be an easier way. Can this be simplified somehow?
Mar 31, 2022 07:29 AM
@David_Goldstein Great workaround to this dilemma! Love your ingenuity here! :slightly_smiling_face:
Mar 31, 2022 07:37 AM
You found the basic technique that I use and described my other post that you found. My formula has a few minor differences from yours:
BLANK()
) as it is not needed.Mar 31, 2022 09:41 PM
@ScottWorld Thanks, but I can’t take much credit for it. @kuovonne pointed me in the right direction and then I found a post where she’d offered a solution to a similar problem. :slightly_smiling_face:
Mar 31, 2022 09:44 PM
Thanks @kuovonne. Changing the “All IDs” field from a Lookup to a Rollup and including the formula in it does eliminate an extra field to clean it up a bit.
Nov 26, 2023 11:21 AM
I have a similar condition where each status requires a unique sequential number as well. i.e. I have projects that have 5 different types of tasks. The example you provided gives a sequential number for all tasks under the project (perfect!) but now I need a different sequential number for each task as well.