Count number of cells in range that contain non-specific text

AVO051

New Member
Joined
Jun 21, 2022
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I’m reaching out regarding a Microsoft Forms multiple-choice survey report I received in Excel. I’ve been working on visualizing the responses in Excel and have successfully created graphs for most of the survey questions. However, I have encountered a challenge with the "Other" category.

Since respondents were able to input free text under "Other," I would like to count the number of rows that contain text in this category. While I have managed to identify rows with non-specified text using a formula, I haven’t been able to correctly apply the SUMPRODUCT function to sum up these rows accurately.

For a single row:
=LEN(SUBSTITUTE(A2;";";""))>SUMPRODUCT((COUNTIF(A2;"*"&$H$2:$H$7&"*"))*LEN($H$2:$H$7))
returns TRUE or FALSE
with A2: cell with the selected multiple-choice ioptions (e.g. Option003;Option00005;Other text)
$H$2:$H$7: a variable list with all multiple-choice ioptions (e.g. Option1, Option02, Option003, Option0004, Option00005, Option000006, erc.)

For a range:
=SUMPRODUCT(LEN(SUBSTITUTE(A2:A12;";";""))>(COUNTIF(A2:A12;"*"&$H$2:$H$7&"*"))*(LEN($H$2:$H$7)))
returns #N/A instead of 3

I have analyzed both parts of the formula I’m using, and it seems that the second part isn’t working as it should. Despite my troubleshooting efforts, I haven’t been able to pinpoint the issue.

Answers Q17Single rowPart 1Part 2RangeQ17 options
Random textTRUE117#N/AOption1
New textTRUE80 Option02
Option003FALSE99 Option003
FALSE00 Option0004
Option003FALSE911 Option00005
Option1;Option003;FALSE1612 Option000006
FALSE0
FALSE0
Option1;FALSE7
Option000006;FALSE12
Option003;Option00005;Other textTRUE30

Would you happen to know of a better approach or formula to resolve this problem? Any suggestions or tips you can provide would be greatly appreciated.

Thank you for your time and support.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This may be an option.
Put the formula in B2 and copy it down.
Excel Formula:
=IF(IFERROR(MATCH(0,BYROW(TEXTSPLIT(A2,,";",TRUE),LAMBDA(br,COUNTIF(H$2:H$7,br))),0),FALSE),TRUE)
 
Upvote 0
This may be an option.
Put the formula in B2 and copy it down.
Excel Formula:
=IF(IFERROR(MATCH(0,BYROW(TEXTSPLIT(A2,,";",TRUE),LAMBDA(br,COUNTIF(H$2:H$7,br))),0),FALSE),TRUE)

I'm looking for a solution that doesn't require adding columns, as I have multiple columns with the same issue, and extra formula columns are increasing the file size.
 
Upvote 0
How about
Fluff.xlsm
ABCDEFGH
1Answers Q17Single rowPart 1Part 2RangeQ17 options
2Random textTRUE1173Option1
3New textTRUE80Option02
4Option003FALSE99Option003
5FALSE00Option0004
6Option003FALSE911Option00005
7Option1;Option003;FALSE1612Option000006
8FALSE0
9FALSE0
10Option1;FALSE7
11Option000006;FALSE12
12Option003;Option00005;Other textTRUE30
Data
Cell Formulas
RangeFormula
E2E2=SUM(MAP(TOCOL(A2:A12,1),LAMBDA(m,SUM(--(COUNTIFS(H2:H7,TEXTSPLIT(m,";",,1))=0)))))
 
Upvote 0
Thank you both for your help! Your insights gave me a new perspective on Excel, leading to this formula as part of a SUMPRODUCT with multiple criteria. I really appreciate it!

=SUMPRODUCT((BYROW(VALUE($AX2:$BB12);LAMBDA(scores;SUM(--(scores<=3))>0)))*(BYROW(TEXTSPLIT(A2:A12;";");LAMBDA(textsplit;SUM(--(COUNTIF(H2:H7;textsplit)))=0))))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,226,498
Messages
6,191,376
Members
453,655
Latest member
lasvegasbuffet

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top