简体   繁体   中英

Use search function for corresponding cells and not entire range

I have data in excel in horizontal way like in the attached image. I need a formula for cell G9 to L9 so that I get 1 in J9. 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.

1

IIUC, try AND and LEFT/LEN :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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