My first [Q] Count element & sub-elements

m.hamadeh

New Member
Joined
Jun 14, 2011
Messages
32
Hello all, I’m happy to join this forum and i hope we all have a lot of benefits here.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
I have a record with hundred of master elements like “60OC-000####” and each element has some sub-elements like “60OC-000####.##” as example see the table below.<o:p></o:p>
<o:p> </o:p>
I can count the total number of sub-element. However I’m facing difficulties to count how many master elements is there. I will be happy to have some help.<o:p></o:p>
<o:p> </o:p>
60OC-0002744.01<o:p></o:p>
60OC-0002801.01<o:p></o:p>
60OC-0002801.02<o:p></o:p>
60OC-0002973.01<o:p></o:p>
60OC-0003041.01<o:p></o:p>
60OC-0003041.02<o:p></o:p>
60OC-0003041.05<o:p></o:p>
60OC-0003041.06<o:p></o:p>
60OC-0003041.21<o:p></o:p>
60OC-0003041.22<o:p></o:p>
60OC-0003041.24<o:p></o:p>
60OC-0003041.25<o:p></o:p>
60OC-0003053.01<o:p></o:p>
60OC-0003053.02<o:p></o:p>
60OC-0003053.03 <o:p></o:p>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Welcome to the board

In a blank column, enter this formula:
Rich (BB code):
=LEFT(A1,LEN(A1)-3)
And drag it down to the last row you have data in.
In the column next to this, enter the formula:
Rich (BB code):
=COUNTIF($A$1:$A$10,J1)
Change J to whatever column the first formula I suggested is in

You could use Advanced Filter after entering the first formula I provided to get a unique list of master values before applying the COUNTIF formula
 
Upvote 0
The second formula worked and I know now how many sub element for each master, but I still don’t know how many master element in total I have.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
Example: in this list above the total is 15 Sub-elements coming from 5 master elements. I need this information to come automatically.<o:p></o:p>
 
Last edited:
Upvote 0
My mistake, that second formula should be:
Rich (BB code):
=COUNTIF($J$1:$J$10,J1)
Where J is whatever column you put the first formula into and change 10 to whatever the last row of data is
 
Upvote 0
Thanks it worked now. Further more I’m able to count the master element using the following formula.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
=SUMPRODUCT((B12:B28<>"")/COUNTIF(B12:B28,B12:B28&""))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,775
Members
452,942
Latest member
VijayNewtoExcel

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