Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 90317

Count unique values based on criteria in 2 other columns in VBA

$
0
0

enter image description here

I have a sheet like:

|   |  A |    B    |   C  |      D     |
|---|:--:|:-------:|:----:|:----------:|
| 1 | ID | Country | Site | Milestones |
| 2 |    |         |      |            |
| 3 |    |         |      |            |

In each ID I can have multiple countries, and for each country, multiple sites and in each site, multiple milestones.

I’m looking to add a column that counts the number of unique sites per country per ID.

I have tried to do this in column E using a formula but I’d prefer this with a VBA loop as it’s part of more code.

I also was not able to account for blanks!

In column f I have what I would have expected. Thanks for help in advance!


Viewing all articles
Browse latest Browse all 90317

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>