Count number of X's in a specific cell

WillWilco

New Member
Joined
Jul 3, 2022
Messages
1
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
How can I create a formula that will count the number of X's in a specific cell on multiple worksheets?
I have 10 worksheets with data that shows if a specific item has been researched or not for multiple students.
The item is located in the same cell on each sheet and I just want to create count of the number of occurrences of the letter X in that specific cell for each student.
Thank you in advance,
Will
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
try...
Book1
AB
1tjX,myX,XrayX4
2tjX,myx,xrayX4
Sheet3
Cell Formulas
RangeFormula
B1B1=LEN(A1)-LEN(SUBSTITUTE(A1,"X",""))
B2B2=LEN(A2)-LEN(SUBSTITUTE(UPPER(A2),"X",""))

Are the "X's" always capitalized? If just one case, then the 1st formula, with the appropriate character. If mixed cases, then the second formula.
 
Last edited:
Upvote 0
The X's are in Cell B2.
VBA Code:
=COUNTA(Sheet1:Sheet10!B2)
 
Upvote 0
@WillWilco , welcome to the Forum!

I interpreted the question similarly to @jolivanes: Items 1 to 10 across the 10 worksheets, Student 1 in A1, Student 2 in A2 etc

But if there are other possibilities than "X" or blank, so that COUNTA won't work reliably ...

1. If you have the new VSTACK function, you could do something like:

=SUM(--(VSTACK(Sheet1:Sheet10!A1)="X"))

2. Otherwise, you'll need to create a sheet array and use INDIRECT. Or if your sheets have consecutive numbering, you could do something like:

=SUM(COUNTIF(INDIRECT("Sheet" &SEQUENCE(10) &"!A1"),"X"))
 
Upvote 0
Another approach

Assuming a single character, or nothing, is in A1 of each sheet & you do not yet have VSTACK.
Excel Formula:
=LET(s,UPPER(CONCAT(Sheet1:Sheet10!A1)),LEN(s)-LEN(SUBSTITUTE(s,"X","")))

If A1 could include multiple characters (eg "XYZ" which should not be counted even though it contains an X?) then
Excel Formula:
=LET(s,UPPER("|"&TEXTJOIN("||",,Sheet1:Sheet10!A1)&"|"),(LEN(s)-LEN(SUBSTITUTE(s,"|X|","")))/3)
 
Upvote 0
For some of us who might still be widening their horizon of knowledge it would be nice to hear what worked the best to fix your problem.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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