Google Spreadsheet,如何在整个 sheet 中搜索相同的匹配项和位于它们右侧的 return 值?
Google Spreadsheet, How to search an entire sheet for same matches and return values located to the right of them?
在 Sheet1 我有很多相同的值,例如名称“boland1”存在于 Sheet1 虽然内容是结构化的,但位置各不相同。每个“boland1”在它们的右边都有不同的值,这就是我要提取的内容。
我正在寻找一个公式来搜索整个第一个 sheet 和 returns 位于每个“boland1”右侧的值。我不希望公式从特定列中进行选择,我已经知道该怎么做。我希望整个 sheet 成为查找范围,这可能吗?
这是一个传播sheet 示例,请查看 sheet 名称以获取信息,还可以查看 Sheet2 以更清楚地了解我正在查找的内容对于:https://docs.google.com/spreadsheets/d/1W8uVmyLS9O907v8Ony-rfbhDuHJqAqsP_eH3Gj1PjUg/edit?usp=sharing
以下是传播sheet 中的一些图片,供不想点击链接的人使用:
使用:
=QUERY({
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-1; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-2; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-3; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-4; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-5; 6)=0))};
"where Col1 = 'Boland1'"; 0)
更新:
=QUERY(SORT({
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-1; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-2; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-3; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-4; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-5; 6)=0))};
FLATTEN(FILTER(COLUMN(Sheet1!A2:1000)*SEQUENCE(ROWS(Sheet1!A2:A);
COLUMNS(Sheet1!A2:1000); 1; 0); MOD(COLUMN(Sheet1!A2:2)-1; 6)=0)); 1);
"where Col1 = 'Boland1'"; 0)
如果你使用 player0 的食谱将 所有 数据堆叠成一个 row-oriented table 并在每一行中包含日期,这将使进一步的处理更容易,像这样:
=query(
{
flatten(filter(iferror(Sheet1!A3:9999 / 0; Sheet1!A1:1); not(mod(column(Sheet1!A3:9999) - 1; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 1; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 2; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 3; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 4; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 5; 6))))
};
"where Col2 is not null order by Col1"; 0
)
准备就绪后,您可以轻松创建多种报告:
=query(Stacked!A1:F; "where B = 'Boland1' "; 1)
=query(Stacked!A1:F; "select B, count(B) where B is not null group by B pivot E"; 1)
在 Sheet1 我有很多相同的值,例如名称“boland1”存在于 Sheet1 虽然内容是结构化的,但位置各不相同。每个“boland1”在它们的右边都有不同的值,这就是我要提取的内容。
我正在寻找一个公式来搜索整个第一个 sheet 和 returns 位于每个“boland1”右侧的值。我不希望公式从特定列中进行选择,我已经知道该怎么做。我希望整个 sheet 成为查找范围,这可能吗?
这是一个传播sheet 示例,请查看 sheet 名称以获取信息,还可以查看 Sheet2 以更清楚地了解我正在查找的内容对于:https://docs.google.com/spreadsheets/d/1W8uVmyLS9O907v8Ony-rfbhDuHJqAqsP_eH3Gj1PjUg/edit?usp=sharing
以下是传播sheet 中的一些图片,供不想点击链接的人使用:
使用:
=QUERY({
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-1; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-2; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-3; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-4; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-5; 6)=0))};
"where Col1 = 'Boland1'"; 0)
更新:
=QUERY(SORT({
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-1; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-2; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-3; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-4; 6)=0))\
FLATTEN(FILTER(Sheet1!A2:1000; MOD(COLUMN(Sheet1!A2:2)-5; 6)=0))};
FLATTEN(FILTER(COLUMN(Sheet1!A2:1000)*SEQUENCE(ROWS(Sheet1!A2:A);
COLUMNS(Sheet1!A2:1000); 1; 0); MOD(COLUMN(Sheet1!A2:2)-1; 6)=0)); 1);
"where Col1 = 'Boland1'"; 0)
如果你使用 player0 的食谱将 所有 数据堆叠成一个 row-oriented table 并在每一行中包含日期,这将使进一步的处理更容易,像这样:
=query(
{
flatten(filter(iferror(Sheet1!A3:9999 / 0; Sheet1!A1:1); not(mod(column(Sheet1!A3:9999) - 1; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 1; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 2; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 3; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 4; 6)))) \
flatten(filter(Sheet1!A3:9999; not(mod(column(Sheet1!A3:9999) - 5; 6))))
};
"where Col2 is not null order by Col1"; 0
)
准备就绪后,您可以轻松创建多种报告:
=query(Stacked!A1:F; "where B = 'Boland1' "; 1)
=query(Stacked!A1:F; "select B, count(B) where B is not null group by B pivot E"; 1)