Here's an Excel sheet, where we track Demand of Products across the countries [Sheet/Table name: Data]
| Country | Products |
|---|---|
| India | A |
| Australia | A,B |
| Brazil | B, C |
This Data will be used to understand the demand of the products across the countries, by simply counting products for each country. This is how the data will look like:
| Products | Demand |
|---|---|
| A | 2 |
| B | 2 |
| C | 1 |
[Sheet/Table name: Product-Demand]
One of the ways, I was able to do this was : Split the comma separated values in the Products Column/cell, and then CountIFS However, this approach involved
- Every time the Data table was updated, manually copy-pasting this to another sheet.
- The products may increase, ex: new product "Z" may be launched
- We use Power BI to create a heat-map of Products in demand across the country. The Power BI Service pulls the data every Monday. Manual effort kind of destroys the automation.
Please advise/guide on
What's the best way to count the products (or comma separated values) in a cell with least amount of manual work.
Thanks!
You need to transform the data into a more useful structure. One way to do that is to use Power Query. Start with your source data as a table called Table1. Then, paste the following code in the Advanced Editor in Power Query:
This code will produce a table of usefully-structured data. The final table you want can be produced by a PivotTable using Power Query's output table as a source.