为什么在Google Sheets中比较多个百分号时,这个查询不起作用?

huangapple go评论58阅读模式
英文:

Why wouldn't this QUERY work when comparing multiple %'s in Google Sheets?

问题

The cells referenced contain 0,1, 0,25, 0,5, 0,75, and the column T where their data sits also contains 0,1, 0,25, 0,5, 0,75, which appear identical, but no results are returned. I'm wondering what I might be missing here.

=QUERY(Dados!A1:V, "select A, B, E, L, ' ', M, N, O, G, F, P, Q, R, T, I, J where T matches '"&G5&"|"&H5&"|"&J5&"|"&K5&"|"&L5&"|"&M5&"|"&N5&"' label ' ' ' '")

英文:

The cells referenced contain 0,1, 0,25, 0,5, 0,75 and the column T where there data sits do have 0,1, 0,25, 0,5, 0,75, which look identical, but nothing gets returned and I wonder what I may be missing here.

=QUERY(Dados!A1:V;"select A, B, E, L, ' ', M, N, O, G, F, P, Q, R, T, I, J where T matches '"&G5&"|"&H5&"|"&J5&"|"&K5&"|"&L5&"|"&M5&"|"&N5&"' label ' ' ' '")

Here is the practical example: https://docs.google.com/spreadsheets/d/1gh5w0czg2JuoA3i5wPu8_eOpC4Q4TXIRhmUrg53nKMU/edit?usp=sharing

答案1

得分: 2

这里是使用filter()无辅助单元格替代方法

=filter(J:K;xmatch(K:K;filter(B1:H1;B2:H2)))

为什么在Google Sheets中比较多个百分号时,这个查询不起作用?

英文:

Here's an alternate approach using filter() and no helper cells

=filter(J:K;xmatch(K:K;filter(B1:H1;B2:H2)))

为什么在Google Sheets中比较多个百分号时,这个查询不起作用?

答案2

得分: 1

你的 QUERY 公式是正确的。这里的关键概念是:“...看起来相同...”。我认为(因为没有提供实际数据),要么你的列 T 中的数据,要么第 5 行中的数据是经过格式化为 2 位小数的计算结果。

如果是这种情况,0.25 不等于 0.25000001。一旦格式化,它们可能看起来相同,但实际上不同。

如果不是这种情况,请分享一个测试表格。

英文:

Your QUERY formula is correct. The key notion here is: "...which look identical...".
I believe (since no actual data has been provided) that either your data in column T or in row 5 are results of calculations formatted to 2 decimals.

If this is the case, 0,25 is NOT equal/the same as 0,25000001. Once formatted they may look the same but are not.

If this is not the case, please share a test sheet.

huangapple
  • 本文由 发表于 2023年6月13日 02:40:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76459438.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定