Visual basic formula based on Date

Utah7

New Member
Joined
Feb 2, 2015
Messages
2
I need help with the visual basic code to calculate interest based on a date. If the date is before 01/27/2015 I need the formula to be Amt*.12/365*days. If it is on or after 01/27/2015, I need it to be Amt*.10/365*days.

ABCD
DateAmtDaysInterest
01/25/2015500.007Amt * .12/365*Days
01/26/2015100.006Amt * .12/365*Days
01/27/2015125.004Amt * .10/365*Days
01/28/2015150.003Amt * .10/365*Days

<tbody>
</tbody>

I have tried using the If ELSE VB conditional statement but can't get it to work. There is actually 100's of dates and calculations in my file.
Thank you for your help.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Are you sure you need VBA code? The following formula would return the desired result in column D
=B2*if(A2<42031,.12,.10)/365*C2
42031 is the number format of 1/27/2015 (number of days after 1/1/1900)
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top