How to get the how many times this come in this sheet

Vishaal

Well-known Member
Joined
Mar 16, 2019
Messages
533
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
  2. Web
Thanks in advance,

I have following sheet
S.no. Marks Yes/no
1. 13. No
2. 16. yes
3. 18. yes
4. 19. No
5. 22 yes
6. 24. yes
7. 26. yes
8. 33. No
9. 35. No
10. 12. yes
11. 17. No
12. 38. yes
13. 40. yes
14. 42. yes
15. 44. yes
16. 46. yes

My query is I want to know how many times

1. 'continuesly three time yes' in third column - come in the above sheet

2. 'continuesly two time yes' in third column - come in the above sheet

3. 'Maximum time continues yes' in third column - comes in the above sheet

And is
1. Three time yes comes only one time
2. Two time yes comes only one time
3. Maximum time continues yes comes is 5

Please provide the VBA code or any formula for the above three point
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number


thanks bro its working.....:);),

please confirm if the sheet rows increase, now its only 16 but if we increase it 16 to 40 then what changes need to be done in formula

"Yes" 2 Times
"Yes" 3 Times
Max "Yes" Times

<colgroup><col></colgroup><tbody>
</tbody>


we need to change only here

For Each Dn In nRng.Areas
If Dn.Count = 2 Then c = c + 1
If Dn.Count = 3 Then b = b + 1
oMax = Application.Max(oMax, Dn.Count)
Next Dn


[D1] = """Yes"" 2 Times": [E1] = c
[D2] = """Yes"" 3 Times": [E2] = b
[D3] = "Max ""Yes"" Times": [e3] = oMax


or any other changes will be required
 
Upvote 0
You don't need to change anything the code will read down to the last row in column "C"
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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