Help with IF, OR formula

%3CLINGO-SUB%20id%3D%22lingo-sub-1862208%22%20slang%3D%22en-US%22%3EHelp%20with%20IF%2C%20OR%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1862208%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20not%20sure%20how%20to%20explain%20this%20but%20I'll%20try%20my%20best.%20I'm%20attempting%20to%20write%20formulas%20to%20configure%20interest%20due%20for%20late%20invoices%20using%202%20different%20interest%20rates%2C%20showing%20amount%20due%20at%20each%20rate%2C%20if%20applicable.%20For%20example%2C%20balances%20not%20paid%20after%20date%20due%20are%20charged%201.5%25%20for%20the%20first%2030%20days%20and%20are%20charged%205%25%20for%2031%20or%20more%20days.%20So%2C%20if%20customer%20A's%20unpaid%20balance%20is%20%241046%20and%20is%2045%20days%20late%2C%20the%20formula%20would%20need%20to%20configure%20the%20interest%20at%20the%201.5%25%20for%2030%20days%2C%20add%20that%20to%20beginning%20balance%2C%20then%20configure%20the%20interest%20at%205%25%20for%20the%20number%20of%20days%20greater%20than%2030%20(in%20this%20case%2C%2015%20days).%20But%20if%20customer%20B's%20balance%20due%20is%2010%20days%20late%2C%20they%20would%20only%20be%20charged%20the%201.5%25.%3C%2FP%3E%3CP%3ESo%2C%20the%20formula%20would%20need%20to%20be%20able%20determine%20whether%20the%20total%20days%20late%20are%20less%20than%20or%20greater%20than%2030%20for%20each.%20The%20interest%20amount%20(without%20the%20original%20balance%20due)%20at%20each%20rate%20level%20needs%20to%20be%20displayed%20in%20separate%20cells.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1862208%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1862391%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20IF%2C%20OR%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1862391%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F860464%22%20target%3D%22_blank%22%3E%40CLaird%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20not%20very%20good%20with%20interest%20calculation%20but%20something%20like%20this%20should%20work.%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(D2%26lt%3B31%2CA2*0.015*D2%2C(A2*0.015*D2)%2B((D2-30)*A2*0.05))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3ESee%20attached%20spreadsheet%20to%20have%20the%20formula%20in%20context.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1862497%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20IF%2C%20OR%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1862497%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F703724%22%20target%3D%22_blank%22%3E%40Bennadeau%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%20I'll%20give%20that%20a%20shot%20and%20hope%20it%20works%20the%20way%20I%20need%20it%20to.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1862620%22%20slang%3D%22en-US%22%3ERe%3A%20Help%20with%20IF%2C%20OR%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1862620%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F860464%22%20target%3D%22_blank%22%3E%40CLaird%3C%2FA%3E%26nbsp%3Bunfortunately%20I%20believe%20there%20is%20an%20error%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F703724%22%20target%3D%22_blank%22%3E%40Bennadeau%3C%2FA%3E%26nbsp%3B%20formula%20because%20%26gt%3B30%20days%20will%20charge%20the%201.5%25%20interest%20rate%20for%20the%20full%20duration%20(assuming%20D2%20is%20the%20days%20overdue).%26nbsp%3B%20Simply%20replacing%20D2%20with%2030%20will%20correct%20that.%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(D2%26lt%3B31%2CA2*0.015*D2%2C(A2*0.015*30)%2B((D2-30)*A2*0.05))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EAlternatively%20you%20can%20simplify%20or%20expand%20that.%26nbsp%3B%20Since%20you%20said%20%22%3CSPAN%3EThe%20interest%20amount%20(without%20the%20original%20balance%20due)%20at%20each%20rate%20level%20needs%20to%20be%20displayed%20in%20separate%20cells.%22%20I%20think%20you%20want%202%20formulas%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DMIN(30%2CD2)*A2*0.015%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DMAX(0%2CD2-30)*A2*0.05%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20also%20replace%20D2%20with%20MAX(0%2CTODAY()-B2)%20where%20B2%20is%20date%20due%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I'm not sure how to explain this but I'll try my best. I'm attempting to write formulas to configure interest due for late invoices using 2 different interest rates, showing amount due at each rate, if applicable. For example, balances not paid after date due are charged 1.5% for the first 30 days and are charged 5% for 31 or more days. So, if customer A's unpaid balance is $1046 and is 45 days late, the formula would need to configure the interest at the 1.5% for 30 days, add that to beginning balance, then configure the interest at 5% for the number of days greater than 30 (in this case, 15 days). But if customer B's balance due is 10 days late, they would only be charged the 1.5%.

So, the formula would need to be able determine whether the total days late are less than or greater than 30 for each. The interest amount (without the original balance due) at each rate level needs to be displayed in separate cells.

 

5 Replies
Highlighted

Hi @CLaird,

 

I'm not very good with interest calculation but something like this should work. 

=IF(D2<31,A2*0.015*D2,(A2*0.015*D2)+((D2-30)*A2*0.05))

See attached spreadsheet to have the formula in context.

Highlighted

@Bennadeau 

Thanks! I'll give that a shot and hope it works the way I need it to.

Highlighted

@CLaird unfortunately I believe there is an error in @Bennadeau  formula because >30 days will charge the 1.5% interest rate for the full duration (assuming D2 is the days overdue).  Simply replacing D2 with 30 will correct that.

=IF(D2<31,A2*0.015*D2,(A2*0.015*30)+((D2-30)*A2*0.05))

Alternatively you can simplify or expand that.  Since you said "The interest amount (without the original balance due) at each rate level needs to be displayed in separate cells." I think you want 2 formulas:

 

=MIN(30,D2)*A2*0.015

 

 

=MAX(0,D2-30)*A2*0.05

 

You can also replace D2 with MAX(0,TODAY()-B2) where B2 is date due

 

Highlighted

@mtarler is right. Thanks for fixing my formula.

Highlighted

@mtarler 

Thanks for the reminder about the max & min formulas. I completely forgot about using those which might work better than the IF, AND, OR formulas I originally thought of using.

I will certainly leave a response once I get this figured out, for those interested & future reference.