How to count string from 1 column based on string in another column

janichohan

New Member
Joined
Sep 23, 2015
Messages
13
HI GUYS I AM NEW TO THIS FORUM I AM BALDY STUCK IN MAKING THS FORMULA N EXCEL 2007.
CAN ANY BODY TELL ME ?

THIS IS THE SAMPLE DATA.. I WANT TO COUNT " MEDIUM CELL VALUES" BASED ON " DISTRICT COLUMN"

FOR EXAMPLE:

DISTRICT--> JAMSHORO HAD FOLLOWING COUNT BASED ON column MEDIUM
SINDHI ( 5 TIMES)
MIX (2 TIMES)
URDU ( 3 TIMES)


CAN ANYBODY HELP ME HOW I PUT THIS THING INTO FORMULA????

S #Province
District
School AnnexGenderMedium
1SindhJamshoroGGPSGirlsSindhi
2SindhJamshoroGBPSBoysSindhi
3SindhJamshoroGPSMixSindhi
4SindhJamshoroGPSMixSindhi
5SindhJamshoroGGPSGirlsMix
6SindhJamshoroGBPSBoysMix
7SindhJamshoroGBPSBoysSindhi
8SindhJamshoroGGPSGirlsUrdu
9SindhJamshoroGPSMixUrdu
10SindhJamshoroGGPSGirlsUrdu
11SindhMatiariGBPSBoysSindhi
12SindhMatiariGPSMixMix
13SindhMatiariGPSMixSindhi
14SindhMatiariGBPSBoysSindhi
15SindhMatiariGBPSBoysSindhi
16SindhMatiariGBPSBoysMix
17SindhMatiariGGPSGirlsSindhi
18SindhMatiariGPSMixUrdu
19SindhMatiariGPSMixMix
20SindhMatiariGPSMixUrdu

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
With your sample data list in A8:F28
And
A1: Jamshoro
A2: Sindhi
A3: Mix
A4: Urdu

This formula, copied down, returns the count of the referenced Medium for the District in A1
Code:
B2:  =COUNTIFS($C$9:$C$40,$A$1,$F$9:$F$40,$A2)
(You might need to use semicolons for delimiters, instead of commas)

Is that something you can work with?
 
Upvote 0
Dear Ron ,
thanks for answering on my post actually i juts tried your given formula but it resulting with " 0 " not counting anything.
i simple copy and paste your formula.
 
Upvote 0
Does your test worksheet match the example I posted?

For example:
A1: a district to match.....Jamshoro
A2: a Medium to match....Sindh

This formula returns the count of Mediums matching "Sindh" in the Jamshoro district:
Code:
B2:  =COUNTIFS($C$9:$C$40,$A$1,$F$9:$F$40,$A2)
or...if your region uses semicolons as a delimiter
Code:
B2: =COUNTIFS($C$9:$C$40;$A$1;$F$9:$F$40;$A2)
 
Upvote 0
dear john i figure out where i was making problem now its working fine :)

thanks for showing interest in guiding me the problem is now solved

the only thing which i am curious about is that can it be possible i pas the string in formula like "=jamshoro" and other one "=Matiari" and it compute results.

the formula you tell me is absolutely working fine except i need to change every-time the district name...

i truly gratitude you in helping me.

regards
jibran
 
Upvote 0
If the district name will change...
Why would you want to embed it into the formula? If you do that, you need to edit every formula whenever the District changes.
With the formula I posted, you only need to enter the District in A1 and the dependent formulas return counts for the new district.
 
Upvote 0
hmmmm sounds good ok i will go with your defined formula Ron
okk thanks for this :)
stay blessed.




bests,
jibran
 
Upvote 0

Forum statistics

Threads
1,215,588
Messages
6,125,691
Members
449,250
Latest member
azur3

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