简体   繁体   English

使用搜索 function 搜索相应的单元格而不是整个范围

[英]Use search function for corresponding cells and not entire range

I have data in excel in horizontal way like in the attached image.我在 excel 中有水平方式的数据,如附图所示。 I need a formula for cell G9 to L9 so that I get 1 in J9.我需要一个单元格 G9 到 L9 的公式,以便在 J9 中得到 1。 I was thinking of something like product(isnumber(search($C5:$C6,G5:G6)) , however, search functions searches both C5 and C6 in G5 and G6. I only want C5 to be searched in G5 and similarly for C6 and G6. I am open to other formulas or VBA solutions.我正在考虑类似product(isnumber(search($C5:$C6,G5:G6))的东西,但是,搜索功能在 G5 和 G6 中同时搜索 C5 和 C6。我只希望在 G5 中搜索 C5 并类似地搜索C6 和 G6。我对其他公式或 VBA 解决方案持开放态度。

1

IIUC, try AND and LEFT/LEN : IIUC,尝试ANDLEFT/LEN

=--AND(LEFT(G5:G6,LEN($C$5:$C$6))=$C$5:$C$6)

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

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