# Dynamic depreciation formula

#### David W 123

##### New Member
Hi everyone.

I have a list of assets (many thousand) with different purchase dates. I would like the cost to be depreciated over 4 months in line with the lower table (% varies by month) and I already have a formula which works well for assets 1 and 2 in the table. However is there a formula which adjusts for number of days, so that for asset 3 (purchased 8 March) : March would be ~23 days of the 40% cost, and April would be ~8 days of the 40% cost and ~23 days of the 30% cost?

Book1
BCDEFGHIJKLMNOPQ
3AssetCostPurchase dateJan-21Feb-21Mar-21Apr-21May-21Jun-21Jul-21Aug-21Sep-21Oct-21Nov-21Dec-21
41500,00001-Feb-210200,000150,000100,00050,0000000000
52600,00001-Mar-2100240,000180,000120,00060,000000000
63800,00008-Mar-21000320,000240,000160,00080,00000000
7
8Cost allocation phasing
9Month 1Month 2Month 3Month 4
1040%30%20%10%
Sheet1
Cell Formulas
RangeFormula
F4:Q6F4=\$C4*IFERROR(INDEX(\$F\$10:\$I\$10,DATEDIF(\$D4,F\$3,"m")+1),0)

Many thanks for your time and help!
David

### Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

#### Peter_SSs

##### MrExcel MVP, Moderator
See if this does what you want.

21 02 11.xlsm
BCDEFGHIJKLMNOPQ
3AssetCostPurchase dateJan-21Feb-21Mar-21Apr-21May-21Jun-21Jul-21Aug-21Sep-21Oct-21Nov-21Dec-21
41500,00001-Feb-210200,000150,000100,00050,0000000000
52600,00001-Mar-2100240,000180,000120,00060,000000000
63800,00008-Mar-2100247,742240,000160,00080,00072,25800000
Depreciation
Cell Formulas
RangeFormula
F4:Q6F4=IF(COUNTIF(\$E4:E4,">0")=4,\$C4-SUM(\$E4:E4),\$C4*IFERROR(INDEX(\$F\$10:\$I\$10,DATEDIF(\$D4-DAY(\$D4)+1,F\$3,"m")+1),0)*IF(EOMONTH(\$D4,0)=EOMONTH(F\$3,0),(DAY(EOMONTH(\$D4,0))-DAY(\$D4)+1)/DAY(EOMONTH(\$D4,0)),1))

#### David W 123

##### New Member
Many thanks for your time Peter - much appreciated!

This doesn't quite work. If an asset is purchased 8th March, I would want March to be 23 days of the 40%, and April to be the remainder 8 days of the 40% and 23 days of the 30%, with May being 8 days of the 30% and 23 days of the 20% and so on. Where as your solution results in the correct position for March, but the corrections don't arise until the final month.

Difficult to succinctly explain and conscious of your time. I think I've established a more manual calculation method, so happy for this to be left unless you can think of a swift fix.

Thanks again - David

#### Peter_SSs

##### MrExcel MVP, Moderator
This doesn't quite work.
Yes, I should have realised that.

See if this monster is better. Note the change to the lookup table in rows 9:10

21 02 11.xlsm
BCDEFGHIJKLMNOPQ
3AssetCostPurchase dateJan-21Feb-21Mar-21Apr-21May-21Jun-21Jul-21Aug-21Sep-21Oct-21Nov-21Dec-21
41500,00001-Feb-210200,000150,000100,00050,0000000000
52600,00001-Mar-2100240,000180,000120,00060,000000000
63800,00008-Mar-2100245,333260,473176,86099,26918,06500000
7
8
9Month 0Month 1Month 2Month 3Month 4Month 5
100%40%30%20%10%0%
Depreciation
Cell Formulas
RangeFormula
F4:Q6F4=IF(F\$3-DAY(F\$3)<\$D4-DAY(\$D4),0,MIN(\$C4*INDEX(\$F\$10:\$K\$10,MIN(COUNTIF(\$E4:E4,">0")+2,6))*(DAY(EOMONTH(G\$3,0))-DAY(\$D4)+1)/DAY(EOMONTH(G\$3,0))+\$C4*INDEX(\$F\$10:\$K\$10,COUNTIF(\$E4:E4,">0")+1)*(DAY(\$D4)-1)/DAY(EOMONTH(F\$3,0)),\$C4-SUM(\$E4:E4)))

Replies
3
Views
179
Replies
0
Views
264
Replies
18
Views
511
Replies
1
Views
140
Replies
1
Views
497

1,128,113
Messages
5,628,777
Members
416,338
Latest member
Spartan5305

### 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.

### Which adblocker are you using?

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

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