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

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

wigi

Well-known Member
Joined
Jul 10, 2006
Messages
7,958
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
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
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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
 

Forum statistics

Threads
1,136,348
Messages
5,675,238
Members
419,555
Latest member
Paddington

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
Top