+ Reply to Thread
Results 1 to 14 of 14

[SOlVED]LookUp and asign value to the right weeks

  1. #1
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    [SOlVED]LookUp and asign value to the right weeks

    Hello Everyone,

    I am trying to figure out which formulas should be used in order to get what I want. I am trying to convert a forecast from monthly to weekly. I have the following criterias:

    Loan Pay first day of month
    Credit Card Pay first day of following month
    IT Agreement Pay on the 19th of every month
    Cell Phone Pay on the 20th of following month
    Insurance Pay on the 26th of every month
    Rent Pre-Pay on last day of prior month
    Royalty Pay Quarterly of 1st day of the 4th month


    I had learned a lot here about LookUp, so I came up with the formula as follow for the loan:

    =IF(OR(AND(DAY(D13+2)<=1,DAY(D13+7)>1),AND(DAY(D13)<=1,DAY(D13+7)>1)),LOOKUP(D13-7,'Sheet 1'!$1:$1,('Sheet 1'!$2:$2)),0)

    But it doesn't work.

    It will be greatly appreciated if someone can give me some hand.

    Thanks.

    Jackson
    Attached Files Attached Files
    Last edited by jackson_hollon; 12-28-2014 at 11:37 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: LookUp and asign value to the right weeks

    See if this will do what you want...

    D14 & D16=INDEX($D2:$R2,MATCH(EOMONTH(D$13,-1)+1,$D$1:$R$1,0))
    D15&D17=INDEX($D3:$R3,MATCH(EOMONTH(D$13,0)+1,$D$1:$R$1,0))

    The other rows would be pretty much a variartion of those 2
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: LookUp and asign value to the right weeks

    Ford,

    Thanks for the reply.

    I used the two you provided here, however, the value showed up at every week. It should be only showed up at the week that is specified, other week should be blank. Please look at my example, use row 14 as example here, you see D14 has $220 ( the week that has the first day of the month), others weeks are blank.


    Could you please take a look again?

    Thanks for the help.

    Jackson

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: LookUp and asign value to the right weeks

    Quote Originally Posted by jackson_hollon View Post

    ...........Please look at my example, use row 14 as example here, you see D14 has $220 ( the week that has the first day of the month), others weeks are blank.

    Jackson
    I'm officially confused at this point.

    "Loan - Pay first day of the month" (row 14) seems clear.....until I start to work on "Credit Card - Pay first day of the following month" (row 15). In the week of 12/28/2014 these are one and the same day, yet the amount for "Credit Card" is a month "behind" the payment for "Loan". I would have expected the amount under 12/28/2014 to be $330....not $300......or if $300 I would expect the "Loan" payment to be $200 instead of the $220 listed. Or the first day of the following month (2/1/2015 ?) would be $363.

    Can you help us out on that one?
    Last edited by FlameRetired; 12-28-2014 at 04:28 AM.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: LookUp and asign value to the right weeks

    Double posted.

  6. #6
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: LookUp and asign value to the right weeks

    FR,

    Thanks for the reply. Regarding the credit card payment. Since it is always pay one month behind, In Dec 28 to Jan 3 week, it should be paying for Dec, which should be $300. In Feb 1, it is paying $330 for Jan payment.


    The loan payment is paid on the 1st day of the current month, and the credit card is paid one month behind.

    I hope I explain clearly.

    For the loan payment, I came up with the following:

    =IF(DAY(D13)=1,HLOOKUP(EOMONTH(D13,0)-1, SUMIF($1:$1,D13,$2:$2),1),IF(OR((EOMONTH(D13,0)=EOMONTH(E13,0)),DAY(E13)=1),0,HLOOKUP(EOMONTH(D13,0)+1, SUMIF($1:$1,D13,$2:$2),1)))


    But it gave me #N/A error. Do you know why?

    Thanks again for the help.

    Jackson

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: LookUp and asign value to the right weeks

    So far I've been able to reconcile my formula with your results table.....up to "Rent - Pre-Pay on last day of prior month". As I understand it the rent payment $847.00 you have under 2/1/2015 should be under 1/25/2015. The rest of your table is consistent with that pattern. Is there any chance that the location of $847.00 in your table is a typo?

    @ the HLOOKUP question: I have not had time to look at that one yet.

  8. #8
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: LookUp and asign value to the right weeks

    FR,

    You are right, the rent of $847 should be under 1/25/15.
    I cannot wait to see how you do it.

    Thanks again for the help.

    Jackson

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: LookUp and asign value to the right weeks

    OK..........this is ugly. I had to resort to CHOOSE in order to keep my thoughts straight. Actually it's not quite as bad as it appears....but could be a nightmare to debug. Fundamentally the first 6 parts of the CHOOSE choices are variations of the same base equation that reconciles where the designated pay dates are. The 7th one.......... the quarterly "Royalty"......... is stand alone. I've included the file, and here is the formula:

    Please Login or Register  to view this content.
    Sorry for the eye-strain. I opted for Code tags to help organize my thoughts for explanation. Each of the line breaks on INDEX are the start of each successive choice. The SUM line is the unique formula for the quarterly "Royalty" section. I thought about making a separate formula for each row, but that would probably be messier. If that is what you'd like to do instead just copy / paste each section accordingly.

    Hope this helps.

    Edit: Just copy and paste the formula into D14 fill down and across. It is not an array formula.
    Last edited by FlameRetired; 12-28-2014 at 11:46 PM.

  10. #10
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: LookUp and asign value to the right weeks

    FR,

    Sorry for making you work during holiday.... That is amazing. I would had no way to come up with such formulas.

    Thank you very very much for the help.

    Jackson

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: LookUp and asign value to the right weeks

    Your welcome, and thanks for the rep.

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: LookUp and asign value to the right weeks

    Jackson,

    Here is the re-work of the formula I alerted you to in PM.
    Please Login or Register  to view this content.
    This should enable you to extend the formula
    indefinitely to the right.....something the former formula would not do. "+(YEAR(D$13)-2015)*12" is the change.

    A heads-up is in order here. I don't know how indefinite "indefinitely" is. OFFSET is a volatile function.....it recalculates with each change in the workbook no matter if the change is referenced by OFFSET or not. If these OFFSET calculations have formulas which are dependent on OFFSET's calculations they also recalculate. If these dependencies accumulate you could experience a slow down in workbook performance. Should you experience an unacceptable slow down in your workbook (you might not) these OFFSETs are the likely "culprits". There are usually alternatives to this, but how to do this with the trailing and every increasingly distanced Royalties SUM range is beyond my current capabilities. Just thought you would want to know about that.
    Last edited by FlameRetired; 01-11-2015 at 03:20 PM.

  13. #13
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: [SOlVED]LookUp and asign value to the right weeks

    FR,

    Thank you very much for the great help. I think this one will look. I need to put more time to understand the formulas and get good at them.

    Thanks again.

    Jackson

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: [SOlVED]LookUp and asign value to the right weeks

    Your welcome....and thanks for the rep!

+ 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. Data Lookup for Last 4 Weeks
    By distortthecode in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-05-2014, 07:57 AM
  2. How to asign Random Task
    By rskfriends in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2014, 07:26 AM
  3. Formula for values asign
    By Calandrin in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 05-23-2013, 06:40 AM
  4. Pre-asign colors for charting.
    By Walt. in forum Excel General
    Replies: 0
    Last Post: 12-12-2011, 10:59 AM
  5. How do I asign a range of cells to a combobox?
    By Christoffer_Col in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2008, 09:07 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