且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将条件格式公式转换为单元格范围的基于单元格的公式?

更新时间:2023-02-04 19:59:02

假定B19中的值用逗号分隔,然后用空格分隔,请尝试:

Assuming the values in B19 are separated by a comma, followed by a space, try:

=sum(ArrayFormula(--(REGEXMATCH(D3:D12, B18&"|"&SUBSTITUTE(B19, ", ", "|")))))

如果逗号后没有空格,请使用,"而不是,". 如果您希望匹配不区分大小写,请尝试:

If there is no space after the comma use "," instead of ", ". If you want the match to be case-insensitive, try:

=sum(ArrayFormula(--(REGEXMATCH(D3:D12, "(?i)"&B18&"|"&SUBSTITUTE(B19, ", ", "|")))))

看看是否可行?