Counting based on conditions

excel_padwan

New Member
Joined
Aug 20, 2009
Messages
24
Ok, I solved one part of my problem, now I have another.

I want to count a column containing any value based on the specific values in another column.

For example;

I have age values in one column. The number can be anything, it doesn't matter. However, I have to base that upon sex, which is represented by a 1, 2, or 3 in another column. How can I get the age column to count based on the the value of the sex column, no matter what value is in the age column?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Does this work for you.

You only need to do a count on the Sex ID surely

Excel Workbook
ABC
1SexAge
2124
3234
4356
5112
6234
7234
8234
9234
10234
11234
12
13SexTotal AgeTotal
141362
1522387
163561
Sheet2
 
Upvote 0
Ok, I solved one part of my problem, now I have another.

I want to count a column containing any value based on the specific values in another column.

For example;

I have age values in one column. The number can be anything, it doesn't matter. However, I have to base that upon sex, which is represented by a 1, 2, or 3 in another column. How can I get the age column to count based on the the value of the sex column, no matter what value is in the age column?
Can you post some sample data and tell us what result you expect?
 
Upvote 0
Say column A is the gender, values 1-3. Column f is the age, whatever number the surveyed group entered.

I want to make column G, H, and I my gender column, sorted male, female, transgendered, respectively. But I don't want them as a count of the data, I want a transference of data into each respective column. Example

A B C D E F G H I
GENDER AGE MALE FEMALE TRANS
1 20
2 24
3 18
1 20

So, as I stated, If column a is a 1, I would like to take the data from column F and transfer the data(20) to the male Column(G), not the count.

Sorry for the crappy table, I don't know how to insert a proper one here.

-J
 
Upvote 0
That is perfect! I apologize for my crappy lost formatted table, but you did great deciphering it.
The easiest way to do that would be to apply autofilter to the data.

Filter on the Gender column then just copy/paste the data to the appropriate range.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,777
Members
452,942
Latest member
VijayNewtoExcel

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