+ Reply to Thread
Results 1 to 14 of 14

Calculate Invoice Due Date from VLOOKUP drop down list

  1. #1
    Registered User
    Join Date
    04-12-2017
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    4

    Calculate Invoice Due Date from VLOOKUP drop down list

    Hi,
    I am trying to produce a basic spreadsheet for accounts that calculates payment due dates of invoices. We have different payment terms for Suppliers (30 days from month end), Sub Contractors (45 days from month end) and Labour Only Sub Contractors (21 days from date of invoice). I have created a drop down list for Suppliers, Sub Contractors and Labour Only's and I have utilised the VLOOKUP function to pull the payment dates through into my spreadsheet. Trouble is I cannot seem to work out the due date given that each item on the list has a different payment term. It's almost as though I need to VLOOKUP a formula from the table rather than a value.

    Any ideas?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,786

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    Welcome to the forum!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-12-2017
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    4

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    Thanks AliGW.

    I have attached the spreadsheet below.

    So Column A has a drop down menu of suppliers, subcontractors and labour onlys.

    I want the due date column to automatically produce the payment due date based on the parameters below.

    Suppliers - Due Date is EOMONTH invoice is dated + 30 days
    Subcontractors - Due Date is EOMONTH invoice is dated + 45 days
    Labour Only's - Due Date is 21 days after invoice is dated
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    Try this:

    =IF(A4="Supplier",EOMONTH(D4+30,0),IF(A4="Sub-Contractor",EOMONTH(D4+45,0),IF(A4="Labour Only",D4+21,"")))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,786

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    Like this:

    =IF(A4="Labour Only",D4+E4,EOMONTH(D4,0)+E4)

  6. #6
    Registered User
    Join Date
    04-12-2017
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    4

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    Wow, that's great guys! The Sub-Contractor, despite having 45 days in the formula still spits out as if it was 30 days?
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,786

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    Use my formula instead of Glenn's.

    See post #5.

  8. #8
    Registered User
    Join Date
    04-12-2017
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    4

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    Brilliant. That has saved me so much time. No doubt I will be back with more questions in the future.

    Thanks once again.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,786

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    You're welcome! See you again.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  10. #10
    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: Calculate Invoice Due Date from VLOOKUP drop down list

    Quote Originally Posted by Jigby View Post
    Wow, that's great guys! The Sub-Contractor, despite having 45 days in the formula still spits out as if it was 30 days?
    Despite your comment in 8 I doubt this is yet correct unless I'm missing something vital.

    There is a subtle but important difference between
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    With the Subcontractors date of 12/4/2017 the former results in 31/5/2017 whilst the latter, which I believe is what you want given #3 and you DO mean 45 days after the Month end date of the Invoice date is 14/6/2017.
    And with the Suppliers requirement of Invoice Date + 30 then that should be 30/5/2017 and not 31/5/2017. Hence I believe the whole formula should be.


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The original default False function for Labour only was also redundant.
    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.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,786

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    Richard - I have used this:

    =EOMONTH(D1,0)+30

    because the OP stated:

    Suppliers - Due Date is EOMONTH invoice is dated + 30 days
    Subcontractors - Due Date is EOMONTH invoice is dated + 45 days
    Labour Only's - Due Date is 21 days after invoice is dated
    This to me means the end of the month of the invoice date (so invoice any time in April would give 30/04/2017) plus 30 days (or 45 in the case of sub-contractors).

    This:

    =EOMONTH(D1+30,0)

    is entirely different, as it would first add 30 days to the invoice date before calculating the end of the month. In practice, the difference might seem subtle, but it's critical to the formula being correct. As the OP has stated, the formula I offered is producing the expected results, so we must assume, surely, that I have interpreted the requirements correctly.

    Or am I missing your point?

  12. #12
    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: Calculate Invoice Due Date from VLOOKUP drop down list

    Hello Ali,

    I agree that the EOMONTH(D1,0)+30 is correct, which is what is contained in the formula I showed.

    I was picking up on the OPs statement that for Subcontractors the rule is
    Subcontractors - Due Date is EOMONTH invoice is dated + 45 days
    and Glenn's formula in #4.

    Now to me that means the due date is calculated by adding 45 days to the month end in which the Invoice is dated. And logically it follows that any date in the month will produce the same due date. i.e. 1st April and 29 April will both produce the same due date of 14 June.

    The same situation applies to Suppliers but of course the 30 days means that the due date will always be the 30th of the following month

    I read your correction #5 (which was only commenting on the 'Labour Only') as implying that you too had the Subcontractors as EOMONTH(D4+45,0)

    I was somewhat perplexed by the OPs #6 where he identified that there was still a problem and then in #8 seemed to agree everything was now correct after he'd presumably added the Labour only formula you gave - which apart from a reference to E4 rather than 21 was the same as Glenn's for that particular element.

    The top and bottom is that I believe the Subbies due date is 14th June and not 31 May.
    Maybe the OP will confirm?

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,786

    Re: Calculate Invoice Due Date from VLOOKUP drop down list

    I agree, and that is what my formula arrives at:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    3
    Invoice Type
    Invoice Name
    Invoice Number
    Invoice Date
    Payment Terms (days)
    Sub Total
    CIS Total
    VAT Total
    Total
    Amount Payable
    Due Date
    4
    Sub-Contractor
    12/04/2017
    45
    £ -
    14/06/2017
    5
    Labour Only
    12/04/2017
    21
    £ -
    03/05/2017
    6
    Supplier
    12/04/2017
    30
    £ -
    30/05/2017
    7
    Direct Debit
    0
    £ -
    Sheet: Sheet1

    Excel 2016 (Windows) 32 bit
    K
    4
    =IF(A4="Labour Only",D4+E4,EOMONTH(D4,0)+E4)
    Sheet: Sheet1

  14. #14
    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: Calculate Invoice Due Date from VLOOKUP drop down list

    ...nevertheless I'm still perplexed.

    At the time the OP said all was well in #9, as far as I can see all they had at that time was Glenn's formula (which gives the wrong date for the Subbies) and your bit of the formula from #5 which only mentioned the Labour Only bit.

    So at that point as far as I can see the Subbies date is wrong but the OP seems to be happy.

+ 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. Calculate number of days between invoice date and today's date
    By JHerrick in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-30-2020, 03:53 PM
  2. [SOLVED] Calculate invoice due date
    By studio52 in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 04-17-2015, 04:00 AM
  3. I need a macro that prints an invoice after choosing a sheet from a drop-down list
    By Robert1311 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2014, 04:49 PM
  4. Replies: 4
    Last Post: 11-04-2012, 12:43 PM
  5. Replies: 1
    Last Post: 09-05-2012, 11:39 AM
  6. Calculate a date based on a drop down list
    By YNWA in forum Excel General
    Replies: 4
    Last Post: 06-08-2012, 08:17 PM
  7. Excel 2007 : Drop list with invoice auto fill?
    By Ray78 in forum Excel General
    Replies: 6
    Last Post: 03-16-2012, 11:50 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