+ Reply to Thread
Results 1 to 15 of 15

As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

  1. #1
    Registered User
    Join Date
    05-02-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Ok it's pretty difficult to describe what I need help with but I'll try my best.

    Currently on Excel, I have a sheet that contains my Income and Outgoings for each week until I get paid the following week (as I get paid weekly).

    What I have done is set it up so that I have conditional formatting on each WEEK DATE cell, so that they change colour to grey when that date is equal or less than TODAY'S DATE so that I know which column I am working from.

    Next I have a cell that has the formula "=MIN(D23:AM23)" to find what the lowest amount will ever be across the whole year however the lowest amount is nearly always the current week so I want "=MIN(D23:AM23)" to change to "=MIN(E23:AM23)" once the following week commences.

    Which I believe is known as a dynamic range. (from what I've read)

    And therefore I need the range to shrink after each week,

    Good Luck guys,

    and thanks!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Do you have row of dates that are the start dates for the weeks?

    Sounds like what you want is to define the range based on a certain day of the current week.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    05-02-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Untitled.png

    This is how it looks at the moment (Ignore the 29th)

    As you can see at the bottom highlighted in green, is how much money I would have left after all income and outgoings.

    this is where the =Min( function is used to find the lowest number so that I don't overspend later on down the line.

    However this means I need to manually change it after the 7th as I'll have more than £73.86 to spend

  4. #4
    Registered User
    Join Date
    05-02-2015
    Location
    Illinois
    MS-Off Ver
    2013
    Posts
    7

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Registered here just to add some insight here. (Well, and I'm looking for a way to do something pretty complex in my budget sheet, but saw this so figured I'd chime in )

    I work in my budget sheet regularly, and I always ran into problems when the week lapsed. Always having to re-enter the date and such...

    What I would suggest is, if you're not concerned with keeping past information (which I don't really need myself...) that you use a column for dates and use the following formula to calculate the Friday based on the current day. (My pay day is each Friday, so in this example, I calculate the most recent Friday)

    Please Login or Register  to view this content.
    This checks if the date above it is a number, which a date is a number... if it is a number, simply increase by 7, because that means above it is actually an already calculated as a Friday, so easy calculation to get the next Friday in line...

    However, that alone doesn't work for the top cell, and I don't want to keep having to re-enter the date every time I delete a week from my budget, so if it's not a number, that means it's the topmost row, so in that case, it then calculates the closest Friday. Basically if today is Friday, use today's date, otherwise, Calculate the most recent Friday's date and display that.

    This with the Heading of Date in A2 (Or A1 if you wanna move it up) will set each day in each row to the next friday following each row. I then have columns for each of my bills and/or expected outgoings... and then a total at the "end of the week"

    After the week ends, I simply delete the top row from the sheet, which simply moves everything up and recalculates the topmost day for the Current Friday.

    There's probably a prettier way to do this, but still, it works for my purpose, and that's all I care about.

    Been quite happy with my budget sheet ever since I started it.

    I'm working on a few ways to make it much more automated.

    Here's one of my more complex functions:

    Please Login or Register  to view this content.
    I won't get into detail here, but basically it checks if a date number falls within the week listed in this row and if so, it returns the amount due from another sheet for the bill that matches the header name, if it doesn't fall into that date range, don't display anything.

    Again, probably an easier way to do all that, and I might have trouble once the year lapses, but I'll tackle that when it happens. But again, it works for me, so, no need to fix it.

    Good luck!

    Here's a picture of how mine looks (Sorry, if you gotta scroll to see this, I work in 1920x1080 resolution):
    Attached Images Attached Images
    Last edited by Unknownforce; 05-02-2015 at 10:36 PM.

  5. #5
    Registered User
    Join Date
    05-02-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Is there a formula for moving past weeks onto another sheet so that they can still be referenced? Because I think that could work too.

    I can't just delete them since the following week uses the past weeks final balance and causes #REF to appear if the past week is deleted.

  6. #6
    Registered User
    Join Date
    05-02-2015
    Location
    Illinois
    MS-Off Ver
    2013
    Posts
    7

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Well, if you look at mine, on the upper left hand corner, there's the balance at the beginning of the week. That's all I have to update when I delete the row. My totals on the right side have the following formula:

    Please Login or Register  to view this content.
    Here's what each Cell represents:
    B3 = Income or Current Balance
    C3 = An extra row for Additional possible income
    W3 = Total at end of week after all charges go through
    Y2 = Total left over from last week after all charges went through.

    So I add my income, last weeks balance remaining, this weeks balance remaining and any extra income to come up with what's left at the end of each week.

    The ISNUMBER again is checking to see if the cell above is actually a number or not, if it's the topmost row, it will see the Heading as the next row up and not calculate it in the total, so that you don't get the #REF error's showing up in the sheet. They DO show up in the formula, but they aren't calculated because ISNUMBNER will just return 0. So I delete the entire row and the formula fixes itself without me having to change anything other than the current balance. I simply log into my bank on Friday, and update the topmost income number with my current balance from my bank. I could take it a step further and add a cell somewhere to be the current balance, and then add an income formula to show the following:

    B3=IF(ISNUMBER(B2),640, >CURRENT BALANCE CELL<)

    This would enter 640 if it's not the topmost cell (which is my income for each week) if it's the topmost cell, it would enter the current balance if it's the topmost cell. Obviously copy/paste to the cells below to fill in the formula to the rest. You could also take it a step further and set the 640 in another cell by itself, and replace that reference with your INCOME cell.

    Granted, this only works with having a single bank account and a single source of income, if you have multiples though, you could just add another column in for that income and add that into the rest of your formulas. Not too complex there.

    But using ISNUMBER to check if it's not the topmost cell helps in a lot of cases when all you need is to know the budget going forward...

    I don't know of a proper way to move the old data to another sheet, I would say that would probably be VB Code at that point... cause it involves macroing and such... You could reference the different sheet in a similar way by using some kind of formula like... CURRENTWEEKINCOME+IF(ISNUMBER(PREVIOUSWEEKINCOME),PREVIOUSWEEKINCOME,OTHERSHEETPREVIOUSWEEK)) which would still update dynamically based on where it is... but the act of moving to another sheet and putting it in the right spot and all that... that's a little complex...

    Hope that helps a little.

  7. #7
    Registered User
    Join Date
    05-02-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    wait, I just want a range to change per week.

    so from 30/04/2015 to the 07/05/2015 it should change from "=MIN(C23:AL23)" to "=MIN(D23:AL23)" once it actually is 07/05/2015. Then once it's 14/05/2015 it would change to "=MIN(E23:AL23)"

    Is there not a formula to do this?
    As I'd like to keep past payments incase I need it in the future.

    Yea... we got a bit sidetracked I think. :/

  8. #8
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Would be easier if you up-loaded your file, or an example thereof (i.e less confidential info).

    Yes, a dynamic range can be created... but quite difficult to say how without knowing what's where to trigger the change. There are some generic examples available of the web, but adapting to one's specific application is where everyone that has a problem runs into that problem And while pictures and descriptions of formuals in certain cells are helpful, we helpful patrons are a lazy bunch... we don't care to mock up a file to your layout just to test theories that have net zero benefit to us (other than helping the person with the dilemma).
    Last edited by jhren; 05-03-2015 at 02:34 PM.

  9. #9
    Registered User
    Join Date
    05-02-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Here, I've attached.
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    If I understand you correctly:
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    05-02-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    This seems to have worked as I wanted, thank you jhren.

    If you don't mind, could you explain how this formula works?

    Thanks again

  12. #12
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    The basic operation is the same as your simple formula, but the OFFSET function reduces the columns on the left as time progresses.

    COUNTIF(C6:AL6,">"&TODAY()) returns 35 currently, so 35-35=0, which is how many columns the reference range is shifted to the right. As each week passes, it gets shifted one more column to right.

    However, that does not shrink the range size, so as each week passes we also have to decrease the width by one column, and that is the purpose of COUNTIF(C6:AL6,">"&TODAY())+1 at the end (the +1 includes the current week).
    Last edited by jhren; 05-03-2015 at 08:56 PM.

  13. #13
    Registered User
    Join Date
    05-02-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Ok, after a few days, I've thought that it would be great if I knew how many weeks I'd have until the min value changes again, however I'm also unsure on how to do this :/

    I'm also planning on using this value to give me and average expenditure per week until the minimum would change, which is easy enough.

    If you guys could help me to make a cell show how many weeks left until the minimum changes again, that would be it for my budget sheet I think

    What I want to do is something like (Todays date - Minimum Value Date)/7 , but I'm not sure how I'd get the Min Value Date

    Thanks again guys for all the help!
    Last edited by Gander_The_Panda; 05-06-2015 at 09:28 PM.

  14. #14
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    See if this works for you...

    Limiting Week: =INDEX(C6:AL6,0,MATCH(B29,C23:AL23,0))
    Remaining Weeks: =MATCH(B29,C23:AL23,0)-MATCH(TODAY(),C6:AL6,1)

  15. #15
    Registered User
    Join Date
    05-02-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Re: As Today's Date Changes, After 7 Days, The Range of The Lookup Changes

    Thanks man, this works a treat (I like the Limiting Week formula that you added too).

    I owe you a couple jhren

+ 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] COUNTIF anumber of entries in a date range 14-30 days before TODAY?
    By HeathWilD in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-31-2015, 05:47 PM
  2. Replies: 1
    Last Post: 01-19-2015, 02:05 PM
  3. [SOLVED] LOOKUP TODAY function within a date range to return a value
    By Mike Brewer in forum Excel General
    Replies: 9
    Last Post: 12-04-2013, 12:09 PM
  4. Replies: 4
    Last Post: 01-17-2013, 01:23 PM
  5. How do I add a range by date over 90 days older than today
    By John DeLosa in forum Excel General
    Replies: 4
    Last Post: 02-16-2006, 05:35 PM

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