Hello. I am entirely new to anything but the most cursory of excel functions, and an online search did not resolve my problem.

Imagine the following situation: 8 people possess three boxes each labelled a, b, and c respectively. Each of the boxes contains a combination of either 3, 2, 1, or 0 oranges, and either 3, 2, 1, or 0 apples. The 8 people are only allowed to keep one of their boxes, however, and must discard the other two. Moreover, the total number of fruits after this selection has ended must be 24, and these 24 must consist of exactly 9 oranges and 15 apples respectively. I would like to make a function that lists the possible combinations of boxes (a, b, or c for each person) based on this total sum of 9 oranges and 15 apples altogether.

Of course I would imagine that based on the contents of the various boxes there might be several possible combinations of boxes or indeed none. Is anyone able to help on how to make this function?

Best,
Peter