+ Reply to Thread
Results 1 to 7 of 7

Help with Formulas

  1. #1
    Registered User
    Join Date
    09-12-2005
    Posts
    8

    Help with Formulas

    I need help with creating a formula. I want to count the total number of individuals who meet a certain criteria in one column and a certain criteria in another column. For example: I want to find out the total number of people who live in Germany and went on a specific trip. For argument sake let's say column A is at lists only Y or N for yes and no, and column B is a list of Countries such as Germany, America, etc. I would like to figure out the total number of individuals who have a Y in column A and the word Germany in column B. This is what I have done so far and it works for counting only those with Germany in column B or a Y in column A:

    =COUNTIF('[Spreadsheet Name.xls]'!$B:$B,"Germany") or
    =COUNTIF('[Spreadsheet Name.xls]'!$A:$A,"Y")

    The first formula will give me the total number of individuals with the word Germany in column B, and the second will give me a total number of individuals with a Y in column A. How can I combine these two formulas to come up with one that will only count those individuals who have both the word Germany in column B and a Y in column A? I appreciate your assistance with this matter. Please respond to [email protected]

    Thanks,
    Fritz

  2. #2
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    =sumproduct(--(A1:A100="Y"),--(B1:B100="Germany"))

    is your formula and next time, it is not necessary to multipost whatever problem you have.

    Regards.
    BenjieLop
    Houston, TX

  3. #3
    Valued Forum Contributor
    Join Date
    06-30-2005
    Location
    Verwood, Dorset, England
    MS-Off Ver
    Excel 2000
    Posts
    479
    Quote Originally Posted by fritzj8
    I need help with creating a formula. I want to count the total number of individuals who meet a certain criteria in one column and a certain criteria in another column. For example: I want to find out the total number of people who live in Germany and went on a specific trip. For argument sake let's say column A is at lists only Y or N for yes and no, and column B is a list of Countries such as Germany, America, etc. I would like to figure out the total number of individuals who have a Y in column A and the word Germany in column B. This is what I have done so far and it works for counting only those with Germany in column B or a Y in column A:

    =COUNTIF('[Spreadsheet Name.xls]'!$B:$B,"Germany") or
    =COUNTIF('[Spreadsheet Name.xls]'!$A:$A,"Y")

    The first formula will give me the total number of individuals with the word Germany in column B, and the second will give me a total number of individuals with a Y in column A. How can I combine these two formulas to come up with one that will only count those individuals who have both the word Germany in column B and a Y in column A? I appreciate your assistance with this matter. Please respond to [email protected]

    Thanks,
    Fritz
    Hi Fritz

    Try this > =SUM((A1:A15="Y")*(B1:B15="Germany"))

    This needs to be enterred as an array, so type in the formula and then press CTRL/Shift/Enter all together

    Change the ranges to suit your data
    Paul

  4. #4
    Registered User
    Join Date
    09-12-2005
    Posts
    8

    Help with Formulas

    Thanks BenjieLop that did it. Now all I need help with figuring out is how to count only those fields that have a date in them. For example: Column C has various dates listed and some of the entries are just text such as 12-Sep-05 or the words Did Not Go. However, all I need to count are only those fields with a date in the block and not text. Any ideas?

  5. #5
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    Quote Originally Posted by fritzj8
    Thanks BenjieLop that did it. Now all I need help with figuring out is how to count only those fields that have a date in them. For example: Column C has various dates listed and some of the entries are just text such as 12-Sep-05 or the words Did Not Go. However, all I need to count are only those fields with a date in the block and not text. Any ideas?
    If I understand you correctly, column C entries are either dates or the words "Did Not Go" and I will assume all the Column C cells are "general" formatted. Your formula will then be

    =countif(C1:C100,"<>Did Not Go")

    Regards.

  6. #6
    Registered User
    Join Date
    09-12-2005
    Posts
    8

    Help with Formulas

    Yes column C is either a date or text, and no the cells are not "general" formatted but rather "date" formatted. It is just that some of them have text rather than a date. I only want to count the fields with an actual date in them for example:

    Column C
    24-Aug-05
    No Show
    01-Sep-05
    12-Sep-05
    No Show

    I want my formula to count just the fields with a date in it and give me a total, which in this example is three. That way I know only three people attended. I do not need to count the fields with text or nothing in them.

    Thanks,
    Fritz

  7. #7
    Forum Contributor
    Join Date
    06-23-2004
    Location
    Houston, TX
    Posts
    571
    The formula that I gave you will still work then. Simply change "Did Not Go" to "No Show" in the formula and you will be OK.


    Regards.

+ 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