+ Reply to Thread
Results 1 to 6 of 6

Get the total of the same item in a column

  1. #1
    Registered User
    Join Date
    04-28-2013
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Get the total of the same item in a column

    Hi is their is better way to find how many items of a certain kind is in a column
    then using For Next loop. for example
    apple
    apple
    apple
    orange
    orange

    result = 4 apples
    2 oranges

    these is just an example is not the program that
    Iam trying to aplied to.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Get the total of the same item in a column

    jotol,

    Try Application.Worksheetfunction.Countif(range, "item") like so:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

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

  3. #3
    Registered User
    Join Date
    04-28-2013
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Get the total of the same item in a column

    Tanks TigerAvatar for the code, But supose we want to search
    a range for an Item and then count how many items are in that range
    would this still work?

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Get the total of the same item in a column

    I don't see why it wouldn't. Can you give some more specifics?

  5. #5
    Registered User
    Join Date
    04-28-2013
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Get the total of the same item in a column

    Yes, I Have two columns Column1 = stages and column 2 = State( Open or Close)
    so I want to be able to count how many open were their and How many Close
    for each stage. In total their is 7 stages but each stage could have close to thousands
    states.
    Last edited by jotol; 05-02-2013 at 11:38 PM.

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Get the total of the same item in a column

    jotol,

    Attached is a sample workbook based on the criteria you described.
    Column A contains the seven different stages
    Column B contains their states (Open/Close)

    Then the quantity of the state per stage is in the table in columns D through F, with this formula in cell E3 and copied over and down:
    Please Login or Register  to view this content.

    If it needs to be VBA instead, just use the Application.Worksheetfunction.Countifs to do the same thing.
    Attached Files Attached Files

+ 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