根据 Google 工作表中的其他列查找最大使用字数

Find maximum used word on the basis of other column in Google Sheets

我想根据身份证号码根据姓氏或姓名中最常用的词过滤一些数据。并希望仅通过公式获得此结果。请仅建议公式。以下是供您参考的数据和所需结果。

使用:

=INDEX(ARRAY_CONSTRAIN(SORTN(QUERY(SPLIT(FLATTEN(A2:A&"×"&SPLIT(B2:B; " ")); "×"); 
 "select Col1,Col2,count(Col2) 
  where Col2 is not null 
  group by Col1,Col2 
  order by count(Col2) desc
  label count(Col2)''"); 9^9; 2; 1; 1); 9^9; 2))