+ Reply to Thread
Results 1 to 4 of 4

Repetitive division problem

  1. #1
    Registered User
    Join Date
    03-23-2021
    Location
    Belgium
    MS-Off Ver
    16.45
    Posts
    6

    Repetitive division problem

    Hi!

    I am incurring a problem related to a division that has to happen for every week. I collected a dataset of the number of ship arrivals (port calls) per country and per week. This indicator is reported on a weekly basis but I would like to obtain a value for each day of that week by dividing this weekly number uniformly over the week.

    As this would be impossible to execute for 100.000 lines manually, I would like to know if there would be a way to automate this by using a formula or VBA.
    You can see in the attached document that there is column country, date, port calls 1x per week, per day. Now, the purpose is to go from the 'port calls 1x per week' to the column 'per day' by making use of an efficient and effective way.

    Thank you in advance!
    Dan
    Attached Files Attached Files
    Last edited by DanVG; 03-30-2021 at 10:23 AM.

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

    Re: Repetitive division problem

    Assuming there is at least 1 visit per week, this should work in C2 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Round as desired.
    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

  3. #3
    Registered User
    Join Date
    03-23-2021
    Location
    Belgium
    MS-Off Ver
    16.45
    Posts
    6

    Re: Repetitive division problem

    Thanks a lot! It worked perfectly

  4. #4
    Registered User
    Join Date
    03-23-2021
    Location
    Belgium
    MS-Off Ver
    16.45
    Posts
    6

    Re: Repetitive division problem

    Hi ChemistB,

    When proceeding with this dataset, another problem occurred. I was able with your help to link the change in port calls to a particular country and date. So the following dataset is created, see attached.

    Now, I wanted to insert a column which includes a lagged factor (a delay) of the difference of 15 days. So that means that the first of January now has to be linked to the difference of the 15th of January. This is easy done, when you have a list representing only one country. If you just equalise the lagged value on the first of January to the 15th of January, it works for the beginning of the period covered but not at the end since it will just start considering the values of the next country in the list.

    So the question is, how to insert a lagged factor without taking the values of the next country into account?

    The attached file represents the countries Aruba and Belgium and are only 2 of the 132 considered countries.

    Thank you in advance.
    DanVG
    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)

Similar Threads

  1. [SOLVED] Problem with division
    By bralew in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-04-2017, 10:38 AM
  2. [SOLVED] Division problem
    By gregb1203 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-27-2013, 02:42 AM
  3. [SOLVED] A complex problem-replacing repetitive numbers with blank
    By pahari75 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 03-01-2013, 11:33 PM
  4. problem with macro in a repetitive task
    By mahmoodn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-03-2011, 09:20 AM
  5. Excel 2007 : Problem With #division/0!
    By baek2 in forum Excel General
    Replies: 8
    Last Post: 10-25-2010, 05:07 AM
  6. Division problem
    By hejs in forum Excel General
    Replies: 6
    Last Post: 02-22-2005, 05:48 PM
  7. [SOLVED] Division problem
    By Wondering in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 01-27-2005, 07:06 PM

Tags for this Thread

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