Pivot Table or VBA - Counting repetitive instances in multiple columns

hoopdy

New Member
Joined
Apr 30, 2018
Messages
3
Hello All - My first time

I have data similar to the following:

Column 1Column 2Column 3Column 4
RobinOstrichDove
OstrichSparrow
DodoRobinSparrowEagle
OstrichDove
Sparrow
RobinSparrow
DodoRobin
OstrichDove
RobinSparrowEagle
Dove

<tbody>
</tbody>

<tbody>
</tbody>
I need to produce a table that shows the total instances of each type of bird from all four columns such that:

BirdTotal
Dove4
Robin5
Ostrich4
Sparrow5
Eagle1
Dodo2
Total21

<tbody>
</tbody>

I tried to create a pivot table, but it only counts the first column, or includes the last three each as a subcategory of the column right before it.

Does anyone know how to do this? Preferably using a pivot table, but, also with VBA if necessary.

Thank you in advance.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You do not have a table nor an array since there is nothing that conforms to the columnar fields.
However, you can still use COUNTIFS.
And yes, you would have to provide the list or reorganize your values to provide the condition.
 
Upvote 0
You do not have a table nor an array since there is nothing that conforms to the columnar fields.
However, you can still use COUNTIFS.
And yes, you would have to provide the list or reorganize your values to provide the condition.

Thank you, but I am relatively new to this. Would you or someone else please explain in more detail?
 
Upvote 0
In Excel, data is stored in table arrangement where a column represents a field and a row represents a record. Each record would have a value in each field.
The relationships is by the intersections of Columns and Rows.
What you have shown is a blob.
A PivotTable MUST have its data arranged in some Tabular method.
IF you have a list of all the possible birds to be counted, you can use that list and the COUNTIFS function to give your Totals.

I'm sure there is VBA to capture the Array of Values and give just a list from Which a Pivot Table could be generated. Mike Girvin might have something in a formula method, but that could be a big array (large number of values.)

Question. The sheet you plan to tabulate is only going to have the names of things that you want counted the occurrence of?
 
Upvote 0
In Excel, data is stored in table arrangement where a column represents a field and a row represents a record. Each record would have a value in each field.
The relationships is by the intersections of Columns and Rows.
What you have shown is a blob.
A PivotTable MUST have its data arranged in some Tabular method.
IF you have a list of all the possible birds to be counted, you can use that list and the COUNTIFS function to give your Totals.

I'm sure there is VBA to capture the Array of Values and give just a list from Which a Pivot Table could be generated. Mike Girvin might have something in a formula method, but that could be a big array (large number of values.)

Question. The sheet you plan to tabulate is only going to have the names of things that you want counted the occurrence of?

This was an example of a small portion of the data in the sheet (I cannot post the actual data).

I figured it out using a query and then "unpivot" on the columns represented by my example table, incorporating that back into the workbook, and creating my pivot tables from that ...

Thanks for your clarifications.
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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