+ Reply to Thread
Results 1 to 2 of 2

For Loop - To count shipping containers per week

  1. #1
    Registered User
    Join Date
    12-04-2018
    Location
    Chicago
    MS-Off Ver
    2010
    Posts
    28

    Question For Loop - To count shipping containers per week

    Hi all,

    I've been coming up with blanks on this issue for weeks, I simply do not know how to solve it. I am attaching a sample sheet for reference on what I am dealing with. We get this massive report once a week and we need to do a forecast based on weeks Column "S" per vendor per port of loading per destination per container type. So in this example the final solution would look like what is listed in sheet 1. I was thinking of using some variation of the for each loop to run through all the lines in the report and generate a table like in sheet 1, but I can't figure out the formula to get this done correctly.

    The challenge which I keep facing is on week 15 Beijiao -> Perris -> ONEY. The containers that moved is 8, and that is because on column "P" line 189 - 191 has the same ref file # but it repeats so that is still counted as 1 even though it is listed 3 times. However same week but with COSU they run sequentially so its 20 even though the REF File is the same as the containers move up in numbers and don't repeat as 001.

    Any ideas on how to tackle this or such?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,522

    Re: For Loop - To count shipping containers per week

    This proposal employs three helper columns on the All Imports sheet and a pivot table.
    The helper columns (T:V) may be moved and/or hidden for aesthetic purposes.
    Column T is populated using: =M2&O2
    Column U is populated using: =COUNTIFS(T$2:T2,T2)=1
    Column V is populated using: =IF(U2=TRUE,1,0)
    The pivot table on the PT sheet is set up like the 'table' on Sheet1 with the exception that container count, which is a value, is displayed after container size, which is a row header.
    The pivot table is in tabular form, with subtotals and grand totals turned off. For the Week:Destination fields on the Layout & Print tab the repeat item labels box is checked.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Minimising number of containers using Solver
    By doodlelurch in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 03-23-2018, 03:19 PM
  2. [SOLVED] Count Week numbers given start and finish week number
    By Vassen in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-30-2016, 01:59 AM
  3. Remaining Containers based on Quantity balance
    By thong127 in forum Excel General
    Replies: 3
    Last Post: 02-18-2015, 05:29 PM
  4. Replies: 3
    Last Post: 07-28-2013, 03:16 PM
  5. Trying to count the number of temps based on dates and matching containers
    By Kfeisse1 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-20-2010, 01:48 PM
  6. Embedded Excel Object - Containers Path and Name
    By GerryO in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2006, 10:40 AM

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