Count three text values

jmersing

Well-known Member
Joined
Apr 14, 2004
Messages
887
I need to count three different textvalues in the range

G11:CX298

Rover, ADDS, Dist


I was trying countif but keep getting a syntax error.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

macleanb

Well-known Member
Joined
Dec 10, 2004
Messages
715
the sumif function will do this very easily - oir you can use sumproduct. I personally find the sumif approach more "approachable" i.e. I can read the formula very easily - and my poor little brain manages to follow. The sumproduct is probably the clever and more effecient way to go - just try doing a search on sumproduct on this site and you will see lots of examples - however I suspect someone will be along shortly....
 
Upvote 0

jmersing

Well-known Member
Joined
Apr 14, 2004
Messages
887
ADVERTISEMENT
I tried this and it seems to work, but I'll bet there is a better way

=COUNTIF($G11:AH298,"=DIST")/4+COUNTIF($G11:AH298,"=ROVER")/4+COUNTIF($G11:AH298,"=ADDS")/4

Thanks
 
Upvote 0

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
20,997
Office Version
  1. 365
Platform
  1. Windows
Try the following array formulas that need to be confirmed with CONTROL+SHIFT+ENTER...

=SUM(COUNTIF(G11:CX298,{"Rover","ADDS","Dist"}))

OR

=SUM(COUNTIF(G11:CX298,A1:A3))

...where A1:A3 contains your 'text values'.

Hope this helps!
 
Upvote 0

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
jmersing said:
I need to count three different textvalues in the range

G11:CX298

Rover, ADDS, Dist


I was trying countif but keep getting a syntax error.

1]

=SUM(COUNTIF(G11:CX298,{"Rover","ADDS","Dist"}))

2]

=SUMPRODUCT(COUNTIF(G11:CX298,A1:A3))

where A1:A3 houses Rover, ADDS, and Dist.
 
Upvote 0

Forum statistics

Threads
1,195,594
Messages
6,010,628
Members
441,558
Latest member
lambierules

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