+ Reply to Thread
Results 1 to 6 of 6

Count ifs - 2 conditions

  1. #1
    Nick
    Guest

    Count ifs - 2 conditions

    Hi I have a list of data shown below, in 2 cloumns.

    I want to do a count if to show the total people in each department and
    location i.e.
    COUNT the number of occurances of people in

    HEAD OFFICE and PRODUCTION

    and then

    the number of occurances of people in

    HEAD OFFICE and FINANCE

    and so on....

    Many thanks

    Location Department

    Head Office Production
    Birmingham Sales
    London Finance
    Head Office Finance
    Head Office Finance
    Head Office Finance
    Head Office Finance
    Head Office Finance
    Head Office Finance
    Head Office Finance
    Head Office Sales
    Head Office Sales
    Head Office Sales
    Head Office Finance
    Head Office Sales
    Head Office Finance
    London Production
    London Production
    London Production
    London Production
    London Production
    London Sales
    London Sales
    London Sales
    London Sales
    London Finance
    London Finance
    Birmingham Production
    Birmingham Production
    Birmingham Production
    Birmingham Production


  2. #2
    Bernard Liengme
    Guest

    Re: Count ifs - 2 conditions

    A Pivot Table would work nicely here, or use SUMPRODUCT
    Let your data be in A1:B100
    In D2:D5 (or however many rows it takes) enter the department names
    In E1:K1 (or however many columns it takes) enter the location names
    In E2 enter =SUMPRODUCT(--($A$1:$A$100=$D2),--($B$1:$B$100=E$1)
    copy down and across you table
    best wishes

    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "Nick" <[email protected]> wrote in message
    news:[email protected]...
    > Hi I have a list of data shown below, in 2 cloumns.
    >
    > I want to do a count if to show the total people in each department and
    > location i.e.
    > COUNT the number of occurances of people in
    >
    > HEAD OFFICE and PRODUCTION
    >
    > and then
    >
    > the number of occurances of people in
    >
    > HEAD OFFICE and FINANCE
    >
    > and so on....
    >
    > Many thanks
    >
    > Location Department
    >
    > Head Office Production
    > Birmingham Sales
    > London Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Sales
    > Head Office Sales
    > Head Office Sales
    > Head Office Finance
    > Head Office Sales
    > Head Office Finance
    > London Production
    > London Production
    > London Production
    > London Production
    > London Production
    > London Sales
    > London Sales
    > London Sales
    > London Sales
    > London Finance
    > London Finance
    > Birmingham Production
    > Birmingham Production
    > Birmingham Production
    > Birmingham Production
    >




  3. #3
    Dave O
    Guest

    Re: Count ifs - 2 conditions

    With locations in cells A5:A35, and Departments in cells B5:B35, and
    assuming an employee count by location/department in cells c5:c35...

    And assuming you have a summary section that looks like this in F5:G15
    Birmingham Finance
    Birmingham Production
    Birmingham Sales

    Head Office Finance
    Head Office Production
    Head Office Sales

    London Finance
    London Production
    London Sales

    ....you can use this formula to summarize:
    =SUMPRODUCT(--(F5=$A$5:$A$35),--(G5=$B$5:$B$35),$C$5:$C$35)


  4. #4
    pinmaster
    Guest

    RE: Count ifs - 2 conditions

    Hi,
    What you need is SUMPRODUCT.

    =SUMPRODUCT((A1:A10="head office")*(B1:B10="production"))

    HTH
    JG

    "Nick" wrote:

    > Hi I have a list of data shown below, in 2 cloumns.
    >
    > I want to do a count if to show the total people in each department and
    > location i.e.
    > COUNT the number of occurances of people in
    >
    > HEAD OFFICE and PRODUCTION
    >
    > and then
    >
    > the number of occurances of people in
    >
    > HEAD OFFICE and FINANCE
    >
    > and so on....
    >
    > Many thanks
    >
    > Location Department
    >
    > Head Office Production
    > Birmingham Sales
    > London Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Sales
    > Head Office Sales
    > Head Office Sales
    > Head Office Finance
    > Head Office Sales
    > Head Office Finance
    > London Production
    > London Production
    > London Production
    > London Production
    > London Production
    > London Sales
    > London Sales
    > London Sales
    > London Sales
    > London Finance
    > London Finance
    > Birmingham Production
    > Birmingham Production
    > Birmingham Production
    > Birmingham Production
    >


  5. #5
    Gary''s Student
    Guest

    RE: Count ifs - 2 conditions

    One option is to use a pivot table. Drag Location and Department into the
    Row area and Count of Department into the data area and what you should see
    is:


    Count of Department
    Location Department Total
    Birmingham Production 4
    Sales 1
    Birmingham Total 5
    Head Office Finance 9
    Production 1
    Sales 4
    Head Office Total 14
    London Finance 3
    Production 5
    Sales 4
    London Total 12
    Grand Total 31

    --
    Gary''s Student


    "Nick" wrote:

    > Hi I have a list of data shown below, in 2 cloumns.
    >
    > I want to do a count if to show the total people in each department and
    > location i.e.
    > COUNT the number of occurances of people in
    >
    > HEAD OFFICE and PRODUCTION
    >
    > and then
    >
    > the number of occurances of people in
    >
    > HEAD OFFICE and FINANCE
    >
    > and so on....
    >
    > Many thanks
    >
    > Location Department
    >
    > Head Office Production
    > Birmingham Sales
    > London Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Finance
    > Head Office Sales
    > Head Office Sales
    > Head Office Sales
    > Head Office Finance
    > Head Office Sales
    > Head Office Finance
    > London Production
    > London Production
    > London Production
    > London Production
    > London Production
    > London Sales
    > London Sales
    > London Sales
    > London Sales
    > London Finance
    > London Finance
    > Birmingham Production
    > Birmingham Production
    > Birmingham Production
    > Birmingham Production
    >


  6. #6
    Nick
    Guest

    RE: Count ifs - 2 conditions

    Wow, quick response!

    Thanks everyone, works a treat!

    "Gary''s Student" wrote:

    > One option is to use a pivot table. Drag Location and Department into the
    > Row area and Count of Department into the data area and what you should see
    > is:
    >
    >
    > Count of Department
    > Location Department Total
    > Birmingham Production 4
    > Sales 1
    > Birmingham Total 5
    > Head Office Finance 9
    > Production 1
    > Sales 4
    > Head Office Total 14
    > London Finance 3
    > Production 5
    > Sales 4
    > London Total 12
    > Grand Total 31
    >
    > --
    > Gary''s Student
    >
    >
    > "Nick" wrote:
    >
    > > Hi I have a list of data shown below, in 2 cloumns.
    > >
    > > I want to do a count if to show the total people in each department and
    > > location i.e.
    > > COUNT the number of occurances of people in
    > >
    > > HEAD OFFICE and PRODUCTION
    > >
    > > and then
    > >
    > > the number of occurances of people in
    > >
    > > HEAD OFFICE and FINANCE
    > >
    > > and so on....
    > >
    > > Many thanks
    > >
    > > Location Department
    > >
    > > Head Office Production
    > > Birmingham Sales
    > > London Finance
    > > Head Office Finance
    > > Head Office Finance
    > > Head Office Finance
    > > Head Office Finance
    > > Head Office Finance
    > > Head Office Finance
    > > Head Office Finance
    > > Head Office Sales
    > > Head Office Sales
    > > Head Office Sales
    > > Head Office Finance
    > > Head Office Sales
    > > Head Office Finance
    > > London Production
    > > London Production
    > > London Production
    > > London Production
    > > London Production
    > > London Sales
    > > London Sales
    > > London Sales
    > > London Sales
    > > London Finance
    > > London Finance
    > > Birmingham Production
    > > Birmingham Production
    > > Birmingham Production
    > > Birmingham Production
    > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1