Formula to calculate dates and amount

wlbamc

Board Regular
Joined
Apr 19, 2016
Messages
99
Office Version
  1. 2016
I am looking for a formula that will calculate the difference between 2 dates and then times that answer by the amount of money. I have an end date of the 31/01/2023 and need to know how many days between that date and 31/03/2023 and then times that by the amount the person pays in this example £100. Any help gratefully received.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Excel actually stores dates as numbers (specifically, the number of days since 1/0/1900).
So all that dates are in Excel are numbers with a special date format applied (you can easily see this by changing the format of any date to General).
This means that to get the number of days between two dates, all you have to do is subtract them!

So then your formula structure simply becomes:
Excel Formula:
=(EndDate - StartDate) * Money

Note, if you want the date range to be inclusive, you may need to add one, i.e.
Excel Formula:
=(EndDate - StartDate + 1) * Money
For example, if the Start and End dates are the same date, would you want that to return 0 or 1 for the number of days in that situation.
If 0, use the first formula structure.
If 1, use the second formula structure.
 
Upvote 1
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Fluff.xlsm
ABCD
1
201/01/202331/01/20231003000
Data
Cell Formulas
RangeFormula
D2D2=(B2-A2)*C2
 
Upvote 1
Solution
Excel actually stores dates as numbers (specifically, the number of days since 1/0/1900).
So all that dates are in Excel are numbers with a special date format applied (you can easily see this by changing the format of any date to General).
This means that to get the number of days between two dates, all you have to do is subtract them!

So then your formula structure simply becomes:
Excel Formula:
=(EndDate - StartDate) * Money

Note, if you want the date range to be inclusive, you may need to add one, i.e.
Excel Formula:
=(EndDate - StartDate + 1) * Money
For example, if the Start and End dates are the same date, would you want that to return 0 or 1 for the number of days in that situation.
If 0, use the first formula structure.
If 1, use the second formula structure.
Thank you, one of my dates wasn't in number format, much appreciated
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Fluff.xlsm
ABCD
1
201/01/202331/01/20231003000
Data
Cell Formulas
RangeFormula
D2D2=(B2-A2)*C2
I will update my version now, and thank you, after changing my date format your formula worked perfectly
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,560
Messages
6,120,222
Members
448,951
Latest member
jennlynn

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