+ Reply to Thread
Results 1 to 10 of 10

Counting the number of instances

  1. #1
    Registered User
    Join Date
    06-23-2011
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    4

    Counting the number of instances

    Hello Everybody

    I am looking for a littel help completing a function on excel. I will explain the scenario to give a little background to the problem...

    OK...I am making a report showing the delivery performance of suppliers. In excel at the moment I have a the following data -

    Supplier
    Order number
    Requested delivery date
    Actual delivery date
    Number of days late or early (negative or positive number)

    Some suppliers have multiple deliveries so multiple rows in excel.

    I am looking for a function or functions that will count the number of late or early deliveries within certain parameters. The parameters are -

    0 (days)
    1 - 2 (days)
    3-7 (days)
    Over 7 (days)

    So for each supplier I would generate a report showing -

    Total number of deliveries
    Total number of deliveries on time (0 days)
    Total number of deliveries on 1-2 days late
    Total number of deliveries on 3-7 days late
    Total number of deliveries on over 7 days late

    Could anyone help me or push me in the right direction? I understand this may need several calculations to achieve the desired results...

    Thanks
    Rhys

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Counting the number of instances

    Hi,

    It would really help to see a workbook with some sample data and the results that you would like to see based on that.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Counting the number of instances

    Thinking about it a pivot table would probably be by far the easiest way to deal with this.

    Dom

  4. #4
    Registered User
    Join Date
    06-23-2011
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Counting the number of instances

    Hi Dom

    I have attached the SS showing the data on one page and the report on the second page...

    Thanks
    Rhys
    Attached Files Attached Files

  5. #5
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Counting the number of instances

    See attached example of how it can be done with a pivot table.

    Dom
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-23-2011
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Counting the number of instances

    Thanks Dom - I apprecaite the help.

    Can you reccomend any good resources to help learn how to use pivot tables...

  7. #7
    Registered User
    Join Date
    06-23-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Counting the number of instances

    You could also get all the required results by using the functions Sumif or Sumifs,I just added a small example of how they work in your workbook,hope that helps......
    Attached Files Attached Files

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Counting the number of instances

    There are some good tutorials here: http://www.datapigtechnologies.com/ExcelMain.htm

    I used grouping to categorise the days late as required.

    Dom

  9. #9
    Registered User
    Join Date
    06-23-2011
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Counting the number of instances

    Thanks Dom

    I have been trying to work through backwards what you have done to create the pivot table but just can't see it to work. (The computer is going through the window shortly :-)

    You couldn't talk me through the steps to create that report could you please?

    Thanks again
    Rhys

  10. #10
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Counting the number of instances

    - Create a blank pivot table
    - Drop Supplier as a Row field and a Data field and Days as a Column Field
    - Select the column headings -24 through to -8, right click and select Group. You will see a second Column field called Group2 and a heading of Group1 is created.
    - Click on the cell with Group 1 in it and type over what you would like to call it, i.e. Over 7 Days Late
    - Select the column headings -7 through to -3, right click and select Group again. Group 2 will be created which can again be renamed
    - Repeat until all the required groups are created.
    - Once the groups are all created you can get rid the original days field

    Note I created an extra group for the days that didn't fit into your spec and hid that using the drop down

    Once you created the table you can post new source data and refresh the range the pivot table is looking at by working back through the pivot table wizard.

    Dom

+ 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