+ Reply to Thread
Results 1 to 8 of 8

Calculation Based on Date Criteria

  1. #1
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    97

    Calculation Based on Date Criteria

    Hello. Before I ask the question, let me explain this. In our country, when we receive traffic fines, if we pay it within 15 days, we receive a 25% discount. If the payment is later than 15 days, we have until 1 month after we are notified to pay the full amount. After 1 month, for each month we don't pay the fine, we get +5% surcharge.

    I created a formula that makes this calculation based on the payment date I would enter. However, it's very long and might force the computer unnecessarily when applied to an entire column (we receive about 100 each month, so there is a lot of rows). I attach a sample excel in which I added the formula for you to check it out. I was wondering if there might be a way to simplify it, make it shorter and more practical.
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.95 for Mac MS 365
    Posts
    8,683

    Re: Calculation Based on Date Criteria

    one problem might be how far out do you want to project the results? I set up a table that you could use in H and I and you can drag it down as far as you like. Then used a vlookup for the payment amount.
    Attached Files Attached Files
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Calculation Based on Date Criteria

    In E2 then drag down.

    =IF(D2<=C2,A2*0.75,IF(D2<=EDATE(B2,1),A2,A2*(1+(0.05*(MONTH(D2)-MONTH(B2)-IF(D2<=EDATE(B2,MONTH(D2)-MONTH(B2)),1,0))))))
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 12-14-2018 at 10:08 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    97

    Re: Calculation Based on Date Criteria

    Quote Originally Posted by kvsrinivasamurthy View Post
    In E2 then drag down.

    =IF(D2<=C2,A2*0.75,IF(D2<=EDATE(B2,1),A2,A2*(1+(0.05*(MONTH(D2)-MONTH(B2)-IF(D2<=EDATE(B2,MONTH(D2)-MONTH(B2)),1,0))))))
    This works unless the payment date is in another year. I love the logic in this formula, but I see it only considers the months of the dates. I tried something on my own, but couldn't quite figure it out.. Can you think of a way to overcome the year issue?

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,646

    Re: Calculation Based on Date Criteria

    This formula is up to 100 months of late payment.
    Cell C2 may be deleted if needed.

    In E2:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Quang PT

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Calculation Based on Date Criteria

    Revised formula including year
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Calculation Based on Date Criteria

    Please try

    =A2*(1+DATEDIF(B2,D2,"m")*0.05-(D2<=B2+15)*0.25)

  8. #8
    Registered User
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    97

    Re: Calculation Based on Date Criteria

    Quote Originally Posted by Bo_Ry View Post
    Please try

    =A2*(1+DATEDIF(B2,D2,"m")*0.05-(D2<=B2+15)*0.25)
    Works flawlessly! Thanks so much!

+ 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. VBA calculation based on month criteria
    By robert989 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-30-2016, 09:56 PM
  2. [SOLVED] Percentage calculation based on multiple date criteria
    By odahilys in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-26-2015, 10:10 AM
  3. Trying to create calculation based on particular criteria
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-30-2014, 03:49 PM
  4. Calculation based on a criteria
    By hoosier5 in forum Excel General
    Replies: 3
    Last Post: 10-25-2011, 10:40 AM
  5. Criteria based calculation help.
    By rosarionyc in forum Excel General
    Replies: 18
    Last Post: 11-19-2010, 05:49 PM
  6. Average Calculation based on criteria
    By Grandma8 in forum Excel General
    Replies: 4
    Last Post: 07-14-2010, 12:41 PM
  7. [SOLVED] Date Calculation According to the Given Criteria
    By earthworm in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-19-2009, 02:46 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