简体   繁体   English

在 Google 表格的排名首选项列表中显示 TRUE 的 COLUMN 编号

[英]Display COLUMN number for TRUE in rank preference list in Google Sheets

I would like the option to toggle the display of compiled rank order responses in a grid between "response indicated" and "response indicated by rank number".我想要在“响应指示”和“响应由等级编号指示”之间切换显示已编译排名顺序响应的选项。 I'm hoping for a formula solution rather than using Apps Script.我希望有一个公式解决方案,而不是使用 Apps 脚本。

The included screenshot displays the current and desired outcome—with current as the example for "response indicated" (link to sheet below).包含的屏幕截图显示了当前和期望的结果——以当前作为“响应指示”的示例(链接到下面的工作表)。

当前和所需结果的屏幕截图

The grid pulls from responses on a separate sheet as shown in the included screenshot.网格从单独工作表上的响应中提取,如随附的屏幕截图所示。 输入数据截图

NOTE:笔记:

  • While the choice order on the input sheet is ordered 1-5, the display grid does not list the options in sort order.虽然输入表上的选择顺序为 1-5,但显示网格并未按排序顺序列出选项。
  • There is a sort checkbox on map.C2 that informs whether the display grid uses the same order as input or sorts alphabetically. map.C2 上有一个排序复选框,用于通知显示网格是使用与输入相同的顺序还是按字母顺序排序。
  • The display grid uses separate formulas (B4 & C4—that do not reference one another) to populate.显示网格使用单独的公式(B4 和 C4 — 不相互引用)来填充。
  • The closest I've been able to generate is the first row toggling to the accurate ranking (using various combinations of QUERY, VLOOKUP, INDEX, MATCH, COLUMN)—but unable to generate an array output so that each row can create a specific response.我能够生成的最接近的是切换到准确排名的第一行(使用 QUERY、VLOOKUP、INDEX、MATCH、COLUMN 的各种组合),但无法生成数组 output 以便每一行都可以创建特定的响应.

current C1 formula (uses named ranges):当前 C1 公式(使用命名范围):

 =ArrayFormula( IF( REGEXMATCH( IF(autoSort, TRANSPOSE(QUERY( TRANSPOSE(QUERY( QUERY(inputTable,"where A is not null order by A",0), "select "&ARRAYFORMULA(JOIN(",","Col"&SEQUENCE(1,5,2))),)),, COLUMNS(QUERY( QUERY(inputTable,"where A is not null order by A",0), "select "&ARRAYFORMULA(JOIN(",","Col"&SEQUENCE(1,5,2))),)))), TRANSPOSE(QUERY( TRANSPOSE(QUERY( QUERY(inputTable,"where A is not null",0), "select "&ARRAYFORMULA(JOIN(",","Col"&SEQUENCE(1,5,2))),)),, COLUMNS(QUERY( QUERY(inputTable,"where A is not null",0), "select "&ARRAYFORMULA(JOIN(",","Col"&SEQUENCE(1,5,2))),))))), autoOptions), CHAR(10003),))

link to example sheet: https://docs.google.com/spreadsheets/d/1eRaRf-0n-VQ2zljqUpk38sMrFlCh19JAcv7IFMeFMw0/edit?usp=sharing示例表链接: https://docs.google.com/spreadsheets/d/1eRaRf-0n-VQ2zljqUpk38sMrFlCh19JAcv7IFMeFMw0/edit?usp=sharing

This should do it:这应该这样做:

=ARRAYFORMULA(IFERROR(VLOOKUP(B4:B&C3:K3,SPLIT(FLATTEN(input!A2:A&input!B2:F&"|"&COLUMN(input!B1:F1)-1),"|",0,0),2,0)))

just a MattKing 's mod with a checkmark switch:只是一个带有复选标记开关的MattKing的模组:

=INDEX(IFNA(VLOOKUP(B4:B&C3:K3, 
 SPLIT(FLATTEN(input!A2:A&input!B2:F&"|"&COLUMN(input!B1:F1)-1&"|"&CHAR(10003)), "|"), 
 IF(C1=TRUE, 3, 2), )))

在此处输入图像描述

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM