+ Reply to Thread
Results 1 to 5 of 5

COuntif / Sumproduct issue

  1. #1
    Registered User
    Join Date
    01-05-2010
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    COuntif / Sumproduct issue

    Hi.

    I am creating a workbook for work.

    The main part I am having trouble with is finding a formula that will sum, when two specific words are entered in two separate fields.

    For Example...

    Column A has a drop down list, with these options: A, B, C, D
    Column B has a drop down list, with these options: 1, 2, 3, 4

    What i want to do is create a table like this:

    A B C D

    1
    2
    3
    4

    So when column A has option A selected, and column B has option 1 selected, i want it to count in the table.

    I want to be able to enter possible combination's multiple times as i go down the workbook, and i would like the table to continue to add up on a separate workbook. Ive tried countif and sumproduct but if i enter the same combination more that once it adds up incorrectly.

    I hope this makes sense

    Thanks

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: COuntif / Sumproduct issue

    The most obvious solution is to use a Pivot Table based on your source data such that:

    Field 1 is ROW field/label
    Field 2 as COLUMN Field/Label
    Field 2 as DATA field set to COUNT

    ...this will generate your matrix... if needed you can use a Dynamic Named Range as source for PT.

  3. #3
    Registered User
    Join Date
    01-05-2010
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: COuntif / Sumproduct issue

    Hmmm, ok...

    My knowledge of excel is fairly limited, here is an example of some of the formulas i was trying to get it to work. That obviously didnt work... XP

    =countif((A5:A10,"A")+countif(B5:B10,"1"))

    =sumproduct(--(A5:A10,"A")--(B5:B10,"1"))

    SO as i enter the options in to columns of a and b, it counted up in my table.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: COuntif / Sumproduct issue

    If you want to use formulae you will need to use SUMPRODUCT* - COUNTIF will not suffice.

    For pointers as to how to use SUMPRODUCT see link in my sig. to Bob Phillips' white paper on the function.

    (*if not using additional concatenation)

  5. #5
    Registered User
    Join Date
    01-05-2010
    Location
    Derby, UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: COuntif / Sumproduct issue

    Would a macro which does the following work for you?

    You have the two drop down lists, and a button.

    You select the two options, then click the button (to run the macro)

    The macro takes the value of the two dropdown lists and logs them on a seperate sheet.

    You could then have a count function to tell you how many of each you have.

+ 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