Special count (Alt + Enter)

hesam bahrani

New Member
Joined
Sep 3, 2018
Messages
23
Hi,

We want to count down a series of duplicate words, now you are in a cell with a single word of all and with
ALT + enter separating
How do we count them?

For Example in this column count (A1:A5 ) of "
Hesam" is 6


A
1Hesam
2Ronaldo
Hesam
3Hesam
Hesam
4Hesam
Ronaldo
5Hesam

<tbody>
</tbody>

Thank you!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Probably a better way but you could try this array formula.

=SUM(LEN(A1:A5)-LEN(SUBSTITUTE(A1:A5,"Hesam","")))/LEN("Hesam")

In fact if your version of Excel has the TEXTJOIN function you could use this non-array formula.

=(LEN(TEXTJOIN("",FALSE,A1:A5))-LEN(SUBSTITUTE(TEXTJOIN("",FALSE,A1:A5), "Hesam", "")))/LEN("Hesam")
 
Upvote 0
You could use sumproduct. Still array but doesnt need the CSE:

=SUMPRODUCT(LEN(A1:A5)-LEN(SUBSTITUTE(PROPER(A1:A5),"Hesam","")))/LEN("Hesam")
 
Upvote 0
Probably a better way but you could try this array formula.

=SUM(LEN(A1:A5)-LEN(SUBSTITUTE(A1:A5,"Hesam","")))/LEN("Hesam")

In fact if your version of Excel has the TEXTJOIN function you could use this non-array formula.

=(LEN(TEXTJOIN("",FALSE,A1:A5))-LEN(SUBSTITUTE(TEXTJOIN("",FALSE,A1:A5), "Hesam", "")))/LEN("Hesam")

Thank you!!:biggrin:
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
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