Forum Discussion

rhuen's avatar
rhuen
Copper Contributor
Feb 03, 2021
Solved

Find the Mode of Row Values Based on ID Column (Favorite Fruits)

Hello all,

 

I am trying to find a way to determine everyone's favorite fruit. This is the table that I have:
ID          Name       Fruit Eaten

1JoeBanana
1JoeBanana
1JoeOrange
2SteveApple
2SteveApple
3CarolBanana
3CarolOrange
3CarolApple
3CarolOrange
3CarolOrange

 

As you can see, not everyone has eaten the same number of fruit. Now imagine there are hundreds or even thousands of people on this list. How might I determine everyone's favorite fruit?

 

Not sure if this will be helpful, but this is what I have added to the table as I am brainstorming:

ID      Name    Fruit        Check  Count  ID2

1JoeBanana 1 
1JoeBanana 1 
1JoeOrangeCheck21
2SteveApple 1 
2SteveAppleCheck22
3CarolBanana 1 
3CarolOrange 2 
3CarolApple 3 
3CarolOrange 4 
3CarolOrangeCheck53

Check=IF(A3=[@ID],"","Check")
Count=IF(D1="Check",1,IF(Table1[@Check]="",E1+1,E1))
ID=IF(D2="Check",[@ID],"")

3 Replies