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


[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD]Hesam[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]Ronaldo
Hesam
[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]Hesam
Hesam
[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD]Hesam
Ronaldo
[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD]Hesam[/TD]
[/TR]
</tbody>[/TABLE]

Thank you!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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