Counting in Different Data Repeated

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all....

how to counting data this below , different name
this layout :

<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th>expected result</th><th>data</th></tr></thead><tbody>
<tr><td>2</td><td>a</td></tr>
<tr><td> </td><td>a</td></tr>
<tr><td>3</td><td>b</td></tr>
<tr><td> </td><td>b</td></tr>
<tr><td> </td><td>b</td></tr>
<tr><td>1</td><td>r</td></tr>
<tr><td>2</td><td>h</td></tr>
<tr><td> </td><td>h</td></tr>
</tbody></table>

anyone would help me, greatly appreciated...

.sst
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Paste this to A2:

=IF(COUNTIF(INDIRECT("$B2:$B"&ROW()),$B2)=1,COUNTIF($B:$B,$B2),"")
 
Last edited by a moderator:
Upvote 0
I would be avoiding the volatile function INDIRECT.

Adjust the $1000 to be large enough to cover any expected data.

Excel Workbook
AB
1resultdata
22a
3a
43b
5b
6b
71r
82h
9h
Sheet1
 
Last edited:
Upvote 0
hi guys...thank you, working well...

if possible, how to make it in macro?
 
Last edited:
Upvote 0
I would be avoiding the volatile function INDIRECT.

Adjust the $1000 to be large enough to cover any expected data.

Sheet1

AB
1resultdata
22a
3a
43b
5b
6b
71r
82h
9h

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
A2=IF(B2=B1,"",COUNTIF(B2:B$1000,B2))

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
May be.. But this formula would not check any previous appearances of, let say, "h" if it had occured randomly in row 4 or 5.
 
Last edited by a moderator:
Upvote 0
May be.. But this formula would not check any previous appearances of, let say, "h" if it had occured randomly in row 4 or 5.
That's true, but
- The OP's data appears to be grouped in column B
- If the values in column B can reappear later in the column, we don't know if the OP wants the values for the whole column counted or just counted for the current group.
- If there can be multiple reappearances and the colunt for the whole column is required, I still would avoid INDIRECT with
=IF(COUNTIF(B$2:B2,B2)=1,COUNTIF(B2:B$1000,B2),"")
 
Last edited:
Upvote 0
if possible, how to make it in macro?
With over 5 years membership of the forum and 1,000+ posts surely you would know by now to ask for a specific method up front if that is what is required? ;)

Further, can you clarify the issue that Flashbond & I have been discussing?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,156
Members
448,948
Latest member
spamiki

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