I have two tables,
and I want to know in the company table the number of different countries per company.
I don`t know how to count the different values for only certain rows.
The solution should be without VBA.
Thank you for your help!
microsoft excel
I have two tables,
and I want to know in the company table the number of different countries per company.
I don`t know how to count the different values for only certain rows.
The solution should be without VBA.
Thank you for your help!
Best Answer
I would use Pivot Tables. The reason being is you don't have to worry about formulas and the Pivot does all the hard work for you. If you update the data all you need to do is click Update on your pivot table and bam, all done.
Basically you would highlight all the information in table 2 and do
Insert -> Pivot Table
Leave the options as default (Select a table) and (New Worksheet) then click OK.
Drag
Company ID
to theRows
block. Drag theCountry ID
to theColumns
block and again to theValues
block.Right click on the
Country ID
under theValues
block and selectValue Field Settings
Change the
Summarize value field by
fromSum
toCount
and clickOK
See the screenshot. This is what you will get.