Count to multiple variable in row using Count if

bluegirl_1962

New Member
Joined
Jun 7, 2011
Messages
10
I have several variables I need to count in one row. Can this be done? I used the Countif function but am only counting row variable.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Was able to figure it out... Thanks! used a sum(countif.range.criteria1), (countif.range.criteria2) etc statement

Maybe a bit easier on you...

=SUM(COUNTIF(DataRange,{"A","B"}))

=SUMPRODUCT(DataRange,CriteriaRange)

where CriteriaRange is a range, say, X2:X3, housing A and B.
 
Upvote 0
I have several variables I need to count in one row. Can this be done? I used the Countif function but am only counting row variable.
Try this...

Use cells to hold the variables to be counted.

Book1
ABCDEFGH
1brownorangeyellowblackorangeblackgreenblue
2________
3CriteriaCount______
4yellow4______
5green_______
6orange_______
Sheet1

This formula entered in B4:

=SUMPRODUCT(--(ISNUMBER(MATCH(A1:H1,A4:A6,0))))
 
Upvote 0
Maybe a bit easier on you...

=SUM(COUNTIF(DataRange,{"A","B"}))

=SUMPRODUCT(DataRange,CriteriaRange)

where CriteriaRange is a range, say, X2:X3, housing A and B.

The latter should have been:

=SUMPRODUCT(COUNTIF(DataRange,CriteriaRange))

or, equivalently...

=SUMPRODUCT(ISNUMBER(MATCH(DataRange,CriteriaRange,0))+0)
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,813
Members
452,945
Latest member
Bib195

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