DCOUNTA

Big Leeroy

New Member
Joined
Oct 14, 2006
Messages
6
Hello,

I am having trouble with the DCOUNTA. Im not sure if it is really the solution im looking for. I would like to cound the number of instances a varable occures within a column that has several Key Words within each cell.

EXAMPLE:

Code:
      A                            B                 C
1  Key Words                      dog                2 
2  dog, cat, pig
3  house, farm, grass
4  dog, pig, farm
5  tree, flour, dirt

I would like the formula to display the total count of the instances of the value located in b1 that occure in the list A2-A5.


Thanks for your help.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi

I don't know if this efficient use of computer resources, but it works...

=SUMPRODUCT(--(LEN(A2:A5)>LEN(SUBSTITUTE(A2:A5,B1,""))))

confirmed with Cntrl-Shift-Enter

Wigi
 
Upvote 0
Hello,

I am having trouble with the DCOUNTA. Im not sure if it is really the solution im looking for. I would like to cound the number of instances a varable occures within a column that has several Key Words within each cell.

EXAMPLE:

Code:
      A                            B                 C
1  Key Words                      dog                2 
2  dog, cat, pig
3  house, farm, grass
4  dog, pig, farm
5  tree, flour, dirt

I would like the formula to display the total count of the instances of the value located in b1 that occure in the list A2-A5.


Thanks for your help.
Book2
ABCD
1Key WordsDog2
2Cat, DogFish1
3Snake, FishFishy1
4Drive, RaceCat2
5Tiger, Dog
6Dogged, Obstinate
7Fishy, CAT
Sheet1


C1, copied down:

=SUMPRODUCT(LEN(SUBSTITUTE($A$2:$A$7," ","")&",")-LEN(SUBSTITUTE(UPPER(SUBSTITUTE($A$2:$A$7," ","")&","),UPPER(B1)&",","")))/LEN(B1&",")

For invoking DCOUNTA instead, you'll need to study:

http://support.microsoft.com/default.aspx?scid=kb;en-us;282851
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,039
Members
448,940
Latest member
mdusw

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