Home > Mobile >  My formula is counting an ID that shares some characters with another ID [Google Sheets/Excel]
My formula is counting an ID that shares some characters with another ID [Google Sheets/Excel]

Time:10-14

I'm using this formula to count the amount of times a couple of IDs are in a list:

=IFERROR((COUNTIFS(DumpGeneral!A:A;"*"&I8&"*";DumpGeneral!A:A;"*"&A$6& "*"))/(COUNTIFS(DumpGeneral!A:A;"*"&A$6&"*"));0)

And the strings I use to find these IDs look like this: M038-P9-G7-T34-T154-T223-T290- In the formula (I8=T15 // A&6=M038)

The issue that I'm having is that with the formula I'm using, IDs like T15 are being counted too when other IDs like T150, T151, T152... are on the string but T15 is not. Is there any solution where I can avoid this problem?

CodePudding user response:

try:

=INDEX(IFERROR((COUNTIFS("-"&DumpGeneral!A:A&"-"; "*-"&I8&"-*"; 
                             DumpGeneral!A:A;     "*"&A$6&"*"))/( 
                COUNTIFS(    DumpGeneral!A:A;     "*"&A$6&"*")); 0))
  • Related