+ Reply to Thread
Results 1 to 10 of 10

Weekly Increase in certain cells

  1. #1
    Registered User
    Join Date
    09-04-2009
    Location
    Huddersfield, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Weekly Increase in certain cells

    Hi, relative novice here. (Sorry if this is in the wrong place).

    What I'm asking is... Is there a way to automatically have a section of a database increase by a constant value at the same time every week?

    I play an online football management game and I keep a database with all the information about my players on it. Each Tuesday, they age by one month, so every Tuesday I have to increase all their ages by 0.1. There can be between 30 and 60 players so you can see it will take some time. So I was wondering if there is any way to shorten this process.

    Thanks for your interest!


  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Weekly Increase in certain cells

    if they are all in one column in a spare cell put 0.1
    copy it
    then select your ages and paste special/add
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Weekly Increase in certain cells

    Put a constant date somewhere in your sheet to represent the beginning of the season. Then subtract the constant date from today's date, divide by 7, then multiply by .1. Add that BACK into the player's starting "age"

    A1: 9/1/2009 (beginning of season)
    A4: =25+(INT((TODAY()-A1)/7)*0.1) (a player's age)

    For each player, just put in their starting age at the beginning of that formula.

    Be sure to format that cell as General.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    09-04-2009
    Location
    Huddersfield, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Weekly Increase in certain cells

    @JBeaucaire:

    Whenever I do this, it decreases the age by one, when I want to be able to increase the age by one.

    Oh and when you mean start of the season, what exactly do you mean? Because I can't type the start of the season in, as that has no effect really on the age. Age goes up every Tuesday by .1. So it's 18.0, next Tuesday it's 18.1, next week it's 18.2, etc.. until you get to 18.11, then it goes 19.0.

    @The other guy: Your way works fine and it's a lot better than what I was doing before it's just that I'm looking for an automatic thing really...

    Maybe if I upload the database and you can see what the picture is.

    The age problem I am asking about is under the "Beta Database V.2.0" tab and is in column "U". As you can see, there is a lot going on in there. The reason I want this to be perfect is because I am going to be soon opening this up to the public (other managers), so they can use it with their own players.

    Thanks again (Sorry I'm being a bit too... you know. lol.)
    Attached Files Attached Files

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Weekly Increase in certain cells

    The season start date is just the "year zero" date. JB suggests 1st September 2009 (which is a Tuesday). If you use the formula he suggests then today the cell will just show the start amount, 25.....but on the following Tuesday - 8th September - the value will go up to 25.1, then the following week it'll increase to 25.2 etc.

    That's the correct sort of approach, I think, but it doesn't cope with your desire to add 12 months, e.g. go in this sequence 25.9, 25.10, 25.11, 26, 26.1.......

    I suggest that it's better to use 25.01, 25.02 etc. then you don't get any confusion between 25.1 and 25.10, in which case you could use this formula in U3

    =INT(25.08)+DOLLARFR((MOD(25.08,1)*100+INT((TODAY()-DATE(2009,9,1))/7))/12,12)

    where 25.08 is your start amount

  6. #6
    Registered User
    Join Date
    09-04-2009
    Location
    Huddersfield, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Weekly Increase in certain cells

    Quote Originally Posted by daddylonglegs View Post

    =INT(25.08)+DOLLARFR((MOD(25.08,1)*100+INT((TODAY()-DATE(2009,9,1))/7))/12,12)

    where 25.08 is your start amount
    So once a player reaches .11, it'll change to .00?

    PS. That is some nice skills you got. Like a foreign language to me... (for now).

    Cheers!

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Weekly Increase in certain cells

    Quote Originally Posted by init4themoney View Post
    So once a player reaches .11, it'll change to .00?
    That's right. Personally I would test, replacing TODAY() in the formula with a cell reference like C1 and then putting various dates in C1 to see thye results for those dates.....

  8. #8
    Registered User
    Join Date
    09-04-2009
    Location
    Huddersfield, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Smile Re: Weekly Increase in certain cells

    Quote Originally Posted by daddylonglegs View Post
    That's right. Personally I would test, replacing TODAY() in the formula with a cell reference like C1 and then putting various dates in C1 to see thye results for those dates.....
    Me again. All's worked fine except the above.

    My guy was 21.11 and turned 22.00. However instead of changing to 22.00, it's carried onto 21.12...

    Any thoughts?

    Cheers!

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Weekly Increase in certain cells

    OK, yes, I see that. MOD function sometimes gives some small rounding errors which causes that. You can add in a ROUND function to make it work correctly......

    =INT(25.08)+DOLLARFR((ROUND(MOD(25.08,1)*100,0)+INT((TODAY()-DATE(2009,9,1))/7))/12,12)

  10. #10
    Registered User
    Join Date
    09-04-2009
    Location
    Huddersfield, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Thumbs up Re: Weekly Increase in certain cells

    Thank you!

    It's all running perfectly now!


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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