+ Reply to Thread
Results 1 to 10 of 10

Count Formula

Hybrid View

  1. #1
    Registered User
    Join Date
    06-04-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Count Formula

    Good Afternoon,

    I have a table

    Dept No Category
    10 Old
    12 Old
    10 New
    15 Old
    18 New
    10 New
    15 Old
    12 New


    I want to achieve this result

    Dept New Old
    10 2 1
    12 1 1
    15 0 2
    18 1 0

    Im not sure how to do this --Your help is greatly appreciated.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,346

    Re: Count Forumula

    A pivot table with Dept as Rows, Category as columns and count of Category as Sums will do you.
    Attached Files Attached Files
    Last edited by MarvinP; 09-28-2010 at 03:38 PM.

  3. #3
    Registered User
    Join Date
    06-04-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Count Forumula

    Hmm....I did not get it....Not sure how its done

  4. #4
    Registered User
    Join Date
    06-04-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Count Formula

    Sorry that this site is nt that helpful. This is the 3rd time that I did not get the right answer.

    =COUNTIFS(A2:A9,10, B2:B9, "Old")

    Thats the formula

    Thanks

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,346

    Re: Count Formula

    Hi raginyi,

    I'm sorry I didn't come up with your final answer. I was thinking you had a lot of data to deal with.

    If you want to test our ability in the future, please let us know it's a test and you already have the answer. That way we can all guess what you're thinking, or perhaps just work with people who want our help.

    In all seriousness, it is much easier to work with an existing workbook with test data. I guess a lot of people have never clicked on the "Go Advanced" button and uploaded a test file. Needing to create your data puts us at a disadvantage as it may not be what you have or need.

    I'm always ready to learn and have recreated my pivot table and used your formula in the attached. I like my answer better. I even have a GrandTotal for each Dept No. Your formula only gives a single number. Is that what you wanted? I guess not.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-14-2008
    Location
    Fort Collins, Co
    MS-Off Ver
    2016
    Posts
    107

    Re: Count Formula

    This forum is GREATLY helpful to me!

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719

    Re: Count Formula

    Thank you 4am, lots of people share that view

    raginiy,

    MarvinP supplied you with a way to solve your problem. Often there are several ways to accomplish something in Excel. Here, for instance I'm sure you could use a pivot table, formulas or VBA.

    Marvin's suggestion would be preferable to many as it automatically supplies the results without you having to provide the criteria, as you would with formulas.

    I suggest that you would improve your experiences here if you do the following:

    1.) Provide as much relevant information up front as possible, including your preference for methods if you have any

    2.) Thank anybody who provides you with a solution, even if that solution isn't entirely suitable for you.

    3.) If a suggested solution isn't suitable for you then perhaps explain why and give any other relevant information.

    Have a nice day
    Audere est facere

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Count Formula

    raginyi,
    Your profile says you are on Excel 2003, COUNTIFS are for 2007 up. If you want it compatable with 2003, you'll need a different equation. Assuming your headers are on sheet2 in row 1 and col A, in B2
    =SUMPRODUCT(--(Sheet1!$A$2:$A$9=$A2),--(Sheet1!$B$2:$B$9= B$1))
    Last edited by ChemistB; 09-28-2010 at 04:30 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Count Formula

    raginiy

    You don't have to post here for your free help! There's lots of Excel consultants that you can pay
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  10. #10
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Count Formula

    Marvin's solution is (recognising my state of enormous ignorance) far better to me.
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

+ 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