+ Reply to Thread
Results 1 to 7 of 7

Increment by number of days or weeks

  1. #1
    Registered User
    Join Date
    04-01-2022
    Location
    athens, greece
    MS-Off Ver
    office 365
    Posts
    48

    Increment by number of days or weeks

    Hello all,

    At the example I attach you will see a table with days and weeks
    Also two dates FROM and TO.

    At the table you will also see next to days or weeks the number that the cost should increment if the days (or weeks) between FROM and TO.
    Can this to be done automatically and better if it can be done with VBA somehow.

    Thank you in advance,

    Gerasimos
    Attached Files Attached Files
    Last edited by gerasimos; 04-27-2022 at 08:26 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Increment by number of days or weeks

    There is really no need or benefit to using VBA for this. Also, your data layout design needs a change to be fully effective. See attached.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Increment by number of days or weeks

    In B18, use this:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Increment by number of days or weeks

    I agree with Jeff's comment.

    I'd just put this one together which includes a lookup table but WideBoy's offering is much better.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    04-01-2022
    Location
    athens, greece
    MS-Off Ver
    office 365
    Posts
    48

    Re: Increment by number of days or weeks

    @6StringJazzer yes you are correct, I dont need VBA but I cannot change the table if it is possible. Thats why I was thought about VBA. But your way sure works . Your solution the result is 900

    @WideBoyDixon thank you, and with your solution the result is 1050
    Last edited by gerasimos; 04-27-2022 at 09:39 AM.

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,583

    Re: Increment by number of days or weeks

    No VBA required. See the ranges used carefully.
    In C18
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Alternatively I have used E16 and B18.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Increment by number of days or weeks

    Quote Originally Posted by gerasimos View Post
    @WideBoyDixon thank you, and with your solution the result is 1050
    Huh? See the attached image.

    WBD
    Attached Images Attached Images

+ 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] A number of days into weeks and days-How do you convert the decimal part of 0.571429
    By Robert Christie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-25-2020, 09:37 PM
  2. Replies: 6
    Last Post: 01-31-2013, 02:50 AM
  3. A number of days into weeks and days
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2005, 09:05 AM

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