有条件格式的怪异行为

发布于 2025-01-24 00:19:33 字数 1457 浏览 0 评论 0 原文

我已将以下两个方程式添加到条件格式中:

绿色: = if(regexMatch(vookexmatch(x2,indirect)(“ deals!$ a $ a $ 2:f”),5,false),“ likees”),r2> = vlookup(x2,间接(“ deals!$ a $ 2:f”),4,false),t2> = vlookup(x2,indirect(“ deals!$ a $ a $ 2:f”),4,false))

红色: = if(regexMatch(vookeup(x2,间接)(“ deals!$ a $ 2:f”),5,false),“ likes”),而不是(r2> = vlookup(x2,间接, “ deals!$ a $ 2:f”),4,false)),而不是(t2> = vlookup(x2,间接(“ deals!$ a $ 2:f”),4,false)))

>颜色应相应地改变,具体取决于目标(在这种情况下的视图)是否满足。

出于任何原因,尽管未达到目标,但第一行决定选择绿色。下面的行是完全相反的。最重要的是,即使我已经将条件格式应用到整列上:

,最后两行根本没有选择颜色。 rel =“ nofollow noreferrer”> “适用于整列p” 我在拖动怪异的行为时也将 该P列中的方程式,但在其他列中也看不到有条件格式的其他行为:

这使我完全困惑,我不确定这是什么情况,因为等式的逻辑似乎并不是问题。

感谢我能为此获得的任何帮助!

作为参考,这是vlookup()函数正在抓取的另一个表:

“

I have added the following two equations to conditional formatting:

Green: =IF(REGEXMATCH(VLOOKUP(X2, INDIRECT("DEALS!$A$2:F"),5, FALSE), "Likes"), R2>=VLOOKUP(X2, INDIRECT("DEALS!$A$2:F"), 4, FALSE), T2>=VLOOKUP(X2, INDIRECT("DEALS!$A$2:F"), 4, FALSE))

Red: =IF(REGEXMATCH(VLOOKUP(X2, INDIRECT("DEALS!$A$2:F"),5, FALSE), "Likes"), NOT(R2>=VLOOKUP(X2, INDIRECT("DEALS!$A$2:F"), 4, FALSE)), NOT(T2>=VLOOKUP(X2, INDIRECT("DEALS!$A$2:F"), 4, FALSE)))

The colors should change accordingly depending on whether the target (views in this case) has been met or not.

Target vs. Live Views

Below I have also added the equation into the cells to check if the logic is correct, which it appears to be (left = green logic, right = red logic).

Logic check in cells

For whatever reason, the first row, despite the target not being met, has decided to select the green color. The row below that is doing the complete opposite. And to top it all off, the last two rows are not selecting a color at all even though I have applied the conditional formatting to the entire column:

Conditional formatting applied to entire column P

I am also experiencing weird behavior when dragging equations within this P column, but do not see this same behavior in other columns that also use conditional formatting:

https://i.gyazo.com/5e002e3d08e8337591573b81d9fc92e2.mp4

This has left me completely baffled, and I am not sure what is going on since the equation's logic does not appear to be the issue.

Appreciate any help I can get with this issue!

For reference, here is the other sheet that the VLOOKUP() function is grabbing from:

DEALS Sheet

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绮烟 2025-01-31 00:19:33

请勿锁定内部中的引用( $ )。如果内容在双引号之间,则是文本字符串,而不是主动引用,并且文本字符串不会受到拖动的影响。

用于绿色使用:

=IF(REGEXMATCH(VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 5, 0), "Likes"), 
 R2>=VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 4, 0), 
 T2>=VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 4, 0))

用于红色使用:

=IF(REGEXMATCH(VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 5, 0), "Likes"),   
 NOT(R2>=VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 4, 0)),   
 NOT(T2>=VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 4, 0)))

​=“ nofollow noreferrer”>演示表


更新:

不要拖动任何东西。 中

=ARRAYFORMULA(IFNA(TEXT(VLOOKUP(Z2:Z,DEALS!A2:F,4,0), 
 "#,###,##0")& " " &VLOOKUP(Z2:Z,DEALS!A2:F,5,0)))

在p2:

do not lock ($) references inside INDIRECT. if stuff is between double quotes it's a text string, not an active reference, and text strings are not affected by dragging.

for green use:

=IF(REGEXMATCH(VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 5, 0), "Likes"), 
 R2>=VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 4, 0), 
 T2>=VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 4, 0))

for red use:

=IF(REGEXMATCH(VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 5, 0), "Likes"),   
 NOT(R2>=VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 4, 0)),   
 NOT(T2>=VLOOKUP(Z2, INDIRECT("DEALS!A2:F"), 4, 0)))

enter image description here

demo sheet


update:

don't drag anything. use this in P2:

=ARRAYFORMULA(IFNA(TEXT(VLOOKUP(Z2:Z,DEALS!A2:F,4,0), 
 "#,###,##0")& " " &VLOOKUP(Z2:Z,DEALS!A2:F,5,0)))

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文