ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   countif, sumif, or whatever - counitg just some psecific values (https://www.excelbanter.com/excel-worksheet-functions/141562-countif-sumif-whatever-counitg-just-some-psecific-values.html)

[email protected]

countif, sumif, or whatever - counitg just some psecific values
 
This is a small table with data from a questionnaire about first job
position and before pension job position:

gender first job before pension job
m worker worker
m secretary boss
f boss boss
m secretary boss
f boss boss
f worker worker
f secretary secretary
m worker secretary

I want to make a table that would count workers, secretaries and
bosses for m-male and f-female separately for both questions,
something like this:
worker secretary boss
m first 2 2 0
pension 1 1 2
f first 1 1 2
pension 1 1 2

Which functions to use to get these counting?
Thanks
Mitja


Stefi

countif, sumif, or whatever - counitg just some psecific values
 
Your original table being in Sheet1

on Sheet2
worker secretary boss
m first f1 -
pension f2 -
f first f3 -
pension f4 -


f1: =SUMPRODUCT(--(Sheet1!$B$1:$B$9=C$1),--(Sheet1!$A$1:$A$9=$A2))
f2: =SUMPRODUCT(--(Sheet1!$C$1:$C$9=C$1),--(Sheet1!$A$1:$A$9=$A2))
f3: =SUMPRODUCT(--(Sheet1!$B$1:$B$9=C$1),--(Sheet1!$A$1:$A$9=$A4))
f4: =SUMPRODUCT(--(Sheet1!$C$1:$C$9=C$1),--(Sheet1!$A$1:$A$9=$A4))


Adjust ranges $A$1:$A$9, $B$1:$B$9, $C$1:$C$9 to the siye meeting the size
of your real table in Sheet1, and fill them to tthe right!

Regards,
Stefi


BoniM

countif, sumif, or whatever - counitg just some psecific values
 
With original data in range A1:A9:
worker
m first =SUMPRODUCT((A2:A9=E2)*(B2:B9=G1))
m pension =SUMPRODUCT((A2:A9=E3)*(C2:C9=G1))
f first =SUMPRODUCT((A2:A9=E4)*(B2:B9=G1))
f pension =SUMPRODUCT((A2:A9=E5)*(C2:C9=G1))

Adjust formulas for additional columns (secretary, boss)

" wrote:

This is a small table with data from a questionnaire about first job
position and before pension job position:

gender first job before pension job
m worker worker
m secretary boss
f boss boss
m secretary boss
f boss boss
f worker worker
f secretary secretary
m worker secretary

I want to make a table that would count workers, secretaries and
bosses for m-male and f-female separately for both questions,
something like this:
worker secretary boss
m first 2 2 0
pension 1 1 2
f first 1 1 2
pension 1 1 2

Which functions to use to get these counting?
Thanks
Mitja




All times are GMT +1. The time now is 04:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com