Oct 02 2023 12:54 PM
I am trying to speed up a process to autofill some data. I am looking to find a formula that will check to see if B2 is less than 27, if it is return the value of A2, if not go to B3 to see if it is less than 27, if it is return A3, if not go to B4, and so on to the end of the list. Any help would be appreciated.
Oct 02 2023 01:58 PM
If I read this correctly, you want the first program that's less than 27:
=INDEX(FILTER(program,session<27),1)
If you want all programs less than 27 then it's:
=FILTER(program,session<27)
Oct 03 2023 07:08 AM
Oct 03 2023 07:13 AM
Oct 03 2023 07:45 AM - edited Oct 03 2023 09:31 AM
Here is a modified version of the data. Some participants chose which program they wanted to attend but there are a lot that didn't which is why I have to fill in a program name. This can be random. As mentioned I can do this manually but it would save time if I could add a formula on row E327 to do as i have described previously and then drag it down to the end of the participant name list so that everyone is in a program but less than 27 in each program.
Oct 03 2023 09:22 AM - edited Oct 03 2023 09:49 AM
SolutionThank you for the workbook.
Here's the formula. I treated this an 'unpacking' of the data. It's a bit longer because I had to avoid a circular reference with the totals in H.
=LET(
counter, SEQUENCE(240),
taken, COUNTIF(ProgramsBooked, program),
available, 27 - taken,
UnPack, LAMBDA(a, v, LET(resize, XLOOKUP(v, program, available, ""), VSTACK(a, EXPAND(v, resize, , v)))),
Sessions_Available, DROP(REDUCE("", program, UnPack), 1),
INDEX(Sessions_Available, counter)
)
.
Oct 03 2023 09:33 AM