Using COUNTIFS in VBA from from a data worksheet to a macro page

harlesbarkly

New Member
Joined
Aug 18, 2014
Messages
4
Hello,
I was wondering if any “excel Studs” knew how to use the countIFs function in excel using strings found in a worksheet cells. This is the last stage of a code I have been working on for a few weeks now. Here is a example so you can better understand the goal of the task.

End Chart should look like this( last column needs to be filled)
YearanimalLocation# at given location
Year 1DogShelter
Year 1CatShelter
Year 1BirdShelter
Year 1DogFarm
Year 1CatFarm
Year 1BirdFarm
Year 1Dog"blank"
Year 1Cat"blank"
Year 1Bird"blank"
Year 2DogShelter
Year 2CatShelter
Year 2BirdShelter
Year 2DogFarm
Year 2CatFarm
Year 2BirdFarm
Year 2Dog"blank"
Year 2Cat"blank"
Year 2Bird"blank"
Year 3DogShelter
Year 3CatShelter
Year 3BirdShelter
Year 3DogFarm
Year 3CatFarm
Year 3BirdFarm
Year 3Dog"blank"
Year 3Cat"blank"
Year 3Bird"blank"

<tbody>
</tbody>

And the data that is used to count the # of occurrences looks like this
Location in year
NameAnimalYear 1Year 2Year 3
RalphDogShelterFarmFarm
GeorgeDogShelterFarm
MollyCatShelterShelterFarm
EveDogShelterShelterFarm
RexCatShelterFarmFarm
TyphoonBirdShelter
ObamaBirdFarmFarmFarm
KittyDogFarmFarmFarm
SirBirdShelterfarm
TommyCatShelterShelter
NickCatShelterFarmFarm
k9DogFarmFarmFarm
NekoCatFarmFarmFarm
inuDogShelterFarm
BuckyDogFarmFarmFarm
InruBirdShelterShelterShelter
enruBirdFarmFarm
luffyDogShelterShelter
midoriBirdFarm
oracleBirdFarm
banksyCatShelter

<tbody>
</tbody>



Note: "Blank" means that the data cell is empty.
I hope all of your days are going well.
From,
a young padawan disciple
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,216,591
Messages
6,131,629
Members
449,658
Latest member
JasonEncon

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