LAMBDA · Tax
MACRS depreciation LAMBDA
xl.macrs returns one year of GDS depreciation. On a $10,000 five-year asset, year 1 is $2,000, the Publication 946 half-year rate.
Syntax =xl.macrs(cost, class, year, [month])
=LAMBDA(cost,class,year,month,
LET(
placed, IF(ISOMITTED(month), 1, month),
amount, MAX(cost, 0),
IF(OR(class=3, class=5, class=7, class=10, class=15, class=20),
LET(
places, IF(class=20, 5, 4),
factor, IF(OR(class=15, class=20), 1.5, 2)/class,
steps, IF(year<1, 1, year),
balances, SCAN(1, SEQUENCE(steps), LAMBDA(balance, recovery,
LET(
left, class-(recovery-1.5),
piece, IF(left<=0.5, balance,
ROUND(MAX(
IF(recovery=1, balance*factor*0.5, balance*factor),
IF(recovery=1, balance*0.5/class, balance/left)
), places)),
balance-piece
)
)),
fraction, IF(year<1, NA(),
IF(year=1, 1, INDEX(balances, year-1))-INDEX(balances, year)),
IF(ISNA(fraction), NA(), ROUND(amount*fraction, 2))
),
IF(class=27.5,
LET(
annual, ROUND(100/27.5, 3),
step, ROUND(annual/12, 3),
first, ROUND((12.5-placed)*step, 3),
extra, IF(AND(year>=10, year<=27), IF((MOD(year, 2)=0)=(placed<=6), 0.001, 0), 0),
rest, 100-(first+26*annual+0.009),
percent, IF(OR(placed<1, placed>12, year<1), NA(),
IF(year=1, first,
IF(year<=9, annual,
IF(year<=27, annual+extra,
IF(year=28, IF(placed<=6, rest, annual),
IF(AND(year=29, placed>=7), rest-annual, 0)))))),
IF(ISNA(percent), NA(), ROUND(amount*percent/100, 2))
),
IF(class=39,
LET(
annual, ROUND(100/39, 3),
step, ROUND(annual/12, 3),
percent, IF(OR(placed<1, placed>12, year<1), NA(),
IF(year=1, ROUND((12.5-placed)*step, 3),
IF(year<=39, annual,
IF(year=40, ROUND((placed-0.5)*step, 3), 0)))),
IF(ISNA(percent), NA(), ROUND(amount*percent/100, 2))
),
NA()
)
)
)
)
)Arguments
| Name | Required | What to pass |
|---|---|---|
| cost | Required | Depreciable basis after land, Section 179, and bonus depreciation. Those three are not computed here. A negative cost returns zero. |
| class | Required | GDS recovery period in years. Use 3, 5, 7, 10, 15, 20, 27.5, or 39. Anything else returns |
| year | Required | Recovery year, starting at 1. A year past the end of the recovery period returns zero. |
| month | Optional | Placed-in-service month, 1 for January through 12 for December. Used for 27.5-year and 39-year property. Omit it and the name uses January. Personal property ignores it and uses the half-year convention. |
Examples
$10,000, 5-year property, recovery year 1
=xl.macrs(10000, 5, 1)Result $2,000.00
$10,000, 5-year property, recovery year 6
=xl.macrs(10000, 5, 6)Result $576.00
$10,000, 7-year property, recovery year 1
=xl.macrs(10000, 7, 1)Result $1,429.00
$220,000 residential building, placed in service in July, year 1
=xl.macrs(220000, 27.5, 1, 7)Result $3,667.40
$100,000 nonresidential building, placed in service in March, year 1
=xl.macrs(100000, 39, 1, 3)Result $2,033.00
| A | B | |
|---|---|---|
| 1 | Cost | 10000 |
| 2 | Class | 5 |
| 3 | Year 1 rate | 0.2 |
| 4 | Depreciation | 2000 |
xl.macrs is one recovery year of MACRS depreciation under the general depreciation system. On $10,000 of 5-year property, year 1 is $2,000. This is not a Form 4562 and it is not advice.
The rates are the ones printed in Publication 946 (2025), Appendix A. The PDF at that address, file date March 13, 2026, was checked on November 30, 2026. Table A-1 is the half-year table for 3-, 5-, 7-, 10-, 15-, and 20-year property. Table A-6 is 27.5-year residential rental property, mid-month. Table A-7a is 39-year nonresidential real property, mid-month. A $220,000 residential building placed in service in July takes 1.667% in year 1, which is $3,667.40, the same figure as the rental depreciation article. Publication 946’s own March example of a $100,000 nonresidential building is 2.033%, which is $2,033.
Add it to the workbook
Copy the formula in the block above, including the line breaks. Choose Formulas, Name Manager, New. Set the name to xl.macrs, the scope to Workbook, and paste into Refers to. Excel Labs can do the same step: open the Advanced Formula Environment, add that name, and save it back to the workbook. A cell then calls =xl.macrs(...). Leave the month out for personal property. For a building, pass 1 through 12. The formula uses ISOMITTED so a missing month becomes January.
The sample workbook, with the name already saved, is macrs-depreciation.xlsx.
The name needs Microsoft 365, Excel 2024, or Excel for the web. Excel 2021 returns #NAME? for LAMBDA even when it already has XLOOKUP, FILTER, or LET. Excel 2021 can copy this rate down a column. Put the class in C1, the recovery year in A2, and the basis remaining at the start of that year in B1 (use 1 in year 1). The result is the fraction of original cost:
=IF(A2=1,ROUND(IF(OR(C1=15,C1=20),1.5,2)/C1/2,IF(C1=20,5,4)),IF(C1-(A2-1.5)<=0.5,B1,ROUND(MAX(B1*IF(OR(C1=15,C1=20),1.5,2)/C1,B1/(C1-(A2-1.5))),IF(C1=20,5,4))))
Depreciation is =ROUND(cost*rate,2). For a building, year 1 as a percent is =ROUND((12.5-month)*ROUND(ROUND(100/life,3)/12,3),3) with life 27.5 or 39, and the dollars are =ROUND(cost*percent/100,2). The sample workbook’s Fallback column has the rest of the published years without LAMBDA.
How it works
Personal property switches from declining balance to straight line when straight line is greater or equal. 3-, 5-, 7-, and 10-year property use 200% declining balance. 15- and 20-year property use 150%. The half-year convention takes half a year in year 1 and the rest in the year after the class life. Each year’s rate is rounded half away from zero, to four decimal places (two as a percent) for 3-, 5-, 7-, 10-, and 15-year property, and to five decimal places (three as a percent) for 20-year property. The last year is whatever is left, so the rates sum to 1. Those rounded rates are Table A-1.
Real property is straight line and mid-month. The full-year percent is 100 divided by the life, rounded half up to three decimals: 3.636% for 27.5 years and 2.564% for 39 years. The monthly piece is that percent divided by 12, rounded the same way: 0.303 and 0.214. Year 1 is that piece times the months from the middle of the placed-in-service month through December. For 39-year property, years 2 through 39 stay at 2.564%, and year 40 is the amount that brings the column to 100%. That is Table A-7a, including the 2.033% March rate in Publication 946’s example.
Table A-6 does not use 3.637% in years 2 through 9. Those eight years are 3.636% in every month. In years 10 through 27 the table adds one thousandth of a percent, 3.637 instead of 3.636, on even recovery years for January through June and on odd recovery years for July through December. Years 28 and 29 are the remainder that makes the column 100%. July of a 27.5-year building is 1.667% in year 1 and 3.636% in year 2.
Limits
Variable declining balance, including a partial period, is VDB. Sum-of-years’ digits book depreciation is SYD. These Publication 946 rates are a different schedule. Mid-quarter convention, bonus depreciation, and Section 179 are out of this formula. Take those, if they apply, before you pass the remaining basis. Land is not depreciable. The tables are the 2025 publication’s Appendix A, which is the GDS table set still in force for a 2026 placed-in-service year. A later revision of Publication 946 can reprint a table. The name does not handle a short tax year, a disposition, or ADS. The rental property calculator and the rental income and expense tracker are separate workbooks.