+ Reply to Thread
Results 1 to 11 of 11

Compare dates and return result for Cash flow forecast

  1. #1
    Registered User
    Join Date
    04-19-2021
    Location
    Riyadh
    MS-Off Ver
    windows 10
    Posts
    5

    Compare dates and return result for Cash flow forecast

    I need help please... Thanks for any expert advise

    =IF(D$1=($C3+(VLOOKUP($A3,$A$22:$C$25,2))+(VLOOKUP($A3,$A$22:$C$25,3))),$B3,0)
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,727

    Re: Compare dates and return result for Cash flow forecast

    whats the issue
    =IF(D$1=($C3+(VLOOKUP($A3,$A$22:$C$25,2))+(VLOOKUP($A3,$A$22:$C$25,3))),$B3,0)

    In first example

    D1 = 1st Jan 21
    Then you add the vlookup for A3 which is 1 , 2nd column so 30
    then you add the vlookup for A3 which is 1 , 3rd column so 60
    which = 1st April 2021

    BUT D1 = 1/1/21 and so does not = 1/4/21 and so 0 returned


    what result did you want ?
    Last edited by etaf; 04-19-2021 at 09:43 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,851

    Re: Compare dates and return result for Cash flow forecast

    Your issue has not been adequately described. In addition, it would be very helpful if you provided a mocked up solution so we can better understand what you are trying to do.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    04-19-2021
    Location
    Riyadh
    MS-Off Ver
    windows 10
    Posts
    5

    Re: Compare dates and return result for Cash flow forecast

    I deeply apologize for my incomplete post yesterday and for not describing the results i was looking for.

    Anyhow, as you can see from my table, what i want is, if my End dates column($C3) will equal to the months/year in the row(D$1), instead of showing the USD 10.00 on that intersection(D3), i want to move the USD 10.00 to April(G3) automatically as a result from my inputs conditions in the table (days lag/collection).

    this is to forecast my collection as the end dates also serves as my invoice date, I hope you understand my statement.
    Thank you.

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,727

    Re: Compare dates and return result for Cash flow forecast

    that makes sense now
    BUT in C3 you have 1st of month and rest of column has endof month - same for the Row 1 D1 is the 1st C1 , d1 etc is the end of month
    So should that be the end of month 31st Jan ?

    using the the formula
    if c3 set to 31/jan/21 - then you get a date of 1st may 21
    if c3 set t0 1/jan/21 - then you get a date of 1 april

    So can you give some more examples of where you want the amount to land
    i want to move the USD 10.00 to April(G3)
    That makes sense for dates 1st - BUT the other dates are the end of month

    We can test the date drived against the 2 headers to see if > then or < to determine which column
    So using AND
    AND ( header > formula , header2 < formula ) to see which column the date falls into
    Last edited by etaf; 04-20-2021 at 05:19 AM.

  6. #6
    Registered User
    Join Date
    04-19-2021
    Location
    Riyadh
    MS-Off Ver
    windows 10
    Posts
    5

    Re: Compare dates and return result for Cash flow forecast

    Thank you, please check my updated attachment, so based on what you suggested, i tried the formula =IF(D$1>=($C3+(VLOOKUP($A3,$A$23:$C$25,2))+(VLOOKUP($A3,$A$23:$C$25,3))),IF(D$1<=($C3+(VLOOKUP($A3,$A$23:$C$25,2))+(VLOOKUP($A3,$A$23:$C$25,3))),$B3,0),0)

    it works, however not as i wanted to because the amount landed exactly on D3 so its (C3)January=(D1)January=(D3)USD 10) even though my lookup table moved it to April (G3).

    what i want is, say (C3)January=(D1)January=i want the USD 10 to land in April(G3) given my lookup table values; with my above formula, i checked G3 and it is "TRUE" however the amount was still "0"

    as you said earlier that;
    D1 = 1st Jan 21
    Then you add the vlookup for A3 which is 1 , 2nd column so 30
    then you add the vlookup for A3 which is 1 , 3rd column so 60
    which = 1st April 2021

    BUT D1 = 1/1/21 and so does not = 1/4/21 and so 0 returned


    Quote Originally Posted by etaf View Post
    that makes sense now
    BUT in C3 you have 1st of month and rest of column has endof month - same for the Row 1 D1 is the 1st C1 , d1 etc is the end of month
    So should that be the end of month 31st Jan ?

    using the the formula
    if c3 set to 31/jan/21 - then you get a date of 1st may 21
    if c3 set t0 1/jan/21 - then you get a date of 1 april

    So can you give some more examples of where you want the amount to land
    - i want the amount to land 90days after the date in C3

    That makes sense for dates 1st - BUT the other dates are the end of month

    We can test the date drived against the 2 headers to see if > then or < to determine which column
    So using AND
    AND ( header > formula , header2 < formula ) to see which column the date falls into
    I am interested more on the MONTHS, as long as they are on the same months regardless of day
    Attached Files Attached Files
    Last edited by LemU3l; 04-20-2021 at 07:42 AM.

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,727

    Re: Compare dates and return result for Cash flow forecast

    I have changed the 2 dates in headers and rows
    As i still not sure i understand why
    D1 = 1st , but C1, D1, E1 etc has the end of the month and not the 1st of month , need to be consistent - so i changed d1 to 31/1/21

    THEN the column
    C3 again says the 1st of month , BUT c4,c5,c6 etc all have the last day of month

    Anyway
    I have used this formula

    =IF(AND(($C3+(VLOOKUP($A3,$A$22:$C$25,2))+(VLOOKUP($A3,$A$22:$C$25,3))-1)<=D$1,($C3+(VLOOKUP($A3,$A$22:$C$25,2))+(VLOOKUP($A3,$A$22:$C$25,3))-1) >= DATE(YEAR(D$1),MONTH(D$1),DAY(1))),$B3,0)

    See if that works
    Spreadsheet attached
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-19-2021
    Location
    Riyadh
    MS-Off Ver
    windows 10
    Posts
    5

    Re: Compare dates and return result for Cash flow forecast

    Thank you very much Mr. Etaf, I really appreciate it.....it worked just like what I wanted it to work. , im still trying to digest the way you formulate it hoping i can emulate your cleverness.

    I have changed the 2 dates in headers and rows
    As i still not sure i understand why
    D1 = 1st , but C1, D1, E1 etc has the end of the month and not the 1st of month , need to be consistent - so i changed d1 to 31/1/21

    THEN the column
    C3 again says the 1st of month , BUT c4,c5,c6 etc all have the last day of month
    It was a mistake, i didn't pay attention to the actual dates as i was executing the EOMONTH function.

    kindly enlighten me a bit about the logic if you please...
    first logic was ($C3+(VLOOKUP($A3,$A$22:$C$25,2))+(VLOOKUP($A3,$A$22:$C$25,3))-1)<=D$1 against the whole given date of D$1 then the second logic against the same date but only reference to the first days of the month, why is so?

    anyway, salute to you Sir and will greatly appreciate more if you could shed light on my small clarification. Thank you

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,727

    Re: Compare dates and return result for Cash flow forecast

    At the moment its checking to see if C3+ "x" days falls between the 1st or end of a month

    So at the moment you are adding 30 or 90 days

    Which will be towards the end of a month around 28th+
    So we have to test to see if that date 28th, 29th, 30th, 31st etc is assigned to that column for the header date, which only has end of month hence the AND ( is the date > or = 1st and less than or = to the end of the month )

    maybe possible to shorten , but thats the logic i used

    AND(($C3+(VLOOKUP($A3,$A$22:$C$25,2))+(VLOOKUP($A3,$A$22:$C$25,3))-1)<=D$1. Is the date less than or equal to the end of the month -as D1 shows the last day of month

    AND
    ($C3+(VLOOKUP($A3,$A$22:$C$25,2))+(VLOOKUP($A3,$A$22:$C$25,3))-1) >= DATE(YEAR(D$1),MONTH(D$1),DAY(1)))
    is the date greater or equal to the 1st of the month

    So if any date produced by adding days to C , and is between those 2 limits , then its TRUE as BOTH formula have to be TRUE - hence the use of an AND()

    So if you happen to change your days , say a type 4 code of 15 days , then it will still work

  10. #10
    Registered User
    Join Date
    04-19-2021
    Location
    Riyadh
    MS-Off Ver
    windows 10
    Posts
    5

    Re: Compare dates and return result for Cash flow forecast

    big thanks Mr.Etaf, i learned so much... again, thank you.

  11. #11
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,727

    Re: Compare dates and return result for Cash flow forecast

    you are welcome

+ 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. Replies: 14
    Last Post: 11-02-2019, 04:55 PM
  2. Replies: 4
    Last Post: 07-23-2017, 11:21 PM
  3. Cash Flow Forecast
    By Gerhard_Botha1986 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2015, 03:44 PM
  4. Help with my cash flow forecast - changing when a payment kicks in
    By mattyh1986 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-12-2012, 08:32 AM
  5. 5 yr cash flow forecast.
    By markmash in forum Excel General
    Replies: 3
    Last Post: 04-06-2009, 08:37 AM
  6. How can I Lookup and sum payments for cash flow forecast?
    By Aaron in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-28-2005, 03:05 PM
  7. Replies: 0
    Last Post: 02-21-2005, 06:06 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