简体   繁体   中英

Case-sensitive match in TEXTJOIN and COUNTIF Excel formula

How can I apply "case-sensitive" match in this COUNTIF (case-insensitive) formula in Microsoft Excel 2019?

=TEXTJOIN(", "; TRUE; IF(COUNTIF(A2; "*"&$D$2:$D$1400&"*"); $D$2:$D$1400; ""))

This formula (written in cell B2) checks if A2 contains a value of D2:D1400 and shows it in a comma separated list.

Actual matching is case-insensitive, but I want to use case-sensitive.

Maybe try to use FIND() since it's case-sensitive:

=TEXTJOIN(", ",,IF(ISNUMBER(FIND(A1,D2:D1400)),D2:D1400,""))

Or, the reversed:

=TEXTJOIN(", ",,IF(ISNUMBER(FIND(D2:D1400,A1)),D2:D1400,""))

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