Depreciation Formula

MutanGFX

New Member
Joined
Aug 25, 2022
Messages
11
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hello!

I need help coming out with a formula that does the following:

On F2 it shows the sum of B collumn if the Category and Month matches, and divide the Price by 10.
Then on G2 I want it to show the same calculation + whatever new value there is new for the month also divided by 10.
And so on.

I made it manually for the categories 2.13.01 and 2.13.02 as to explain visually my end goal.

Thank you in advance!

Book1
ABCDEFGHIJKLMNOPQRSTUVWX
1CategoryPriceDate01/01/202201/02/202201/03/202201/04/202201/05/202201/06/202201/07/202201/08/202201/09/202201/10/202201/11/202201/12/202201/01/202301/02/202301/03/202301/04/202301/05/202301/06/202301/07/2023
22.13.0145002/07/20222.13.01606060606060105105105105454545454545
32.13.0285002/07/20222.13.0255590909090909090858585
42.13.0390030/09/20222.13.03
52.13.0420030/10/20222.13.04
62.13.0595003/01/20222.13.05
72.13.0645002/02/20222.13.06
82.13.0785003/05/20222.13.07
92.13.0875004/03/20222.13.08
102.13.0925004/03/20222.13.09
112.13.1015031/08/20222.13.10
122.13.0160003/01/2022
132.13.025003/04/2022
142.13.0380004/03/2022
152.13.0485030/10/2022
162.13.0590004/03/2022
172.13.0640004/03/2022
182.13.0760003/04/2022
192.13.0855003/01/2022
202.13.0925031/08/2022
212.13.1030030/10/2022
Sheet1
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
One way is to use a boolean structure like:

Excel Formula:
=SUM((MONTH($C$2:$C$21)=MONTH(F$1))*(YEAR($C$2:$C$21)=YEAR(F$1))*($A$2:$A$21=$E2)*$B$2:$B$21)/10
 
Upvote 0
One way is to use a boolean structure like:

Excel Formula:
=SUM((MONTH($C$2:$C$21)=MONTH(F$1))*(YEAR($C$2:$C$21)=YEAR(F$1))*($A$2:$A$21=$E2)*$B$2:$B$21)/10

That gives me the total value for each month when the price occours, but it doesn't spill the /10 to the next 9 months.
 
Upvote 0
Right, I read that wrong at first. Try below:

Book1
ABCDEFGHIJKLMNOPQRSTUVWX
1CategoryPriceDate1-1-20221-2-20221-3-20221-4-20221-5-20221-6-20221-7-20221-8-20221-9-20221-10-20221-11-20221-12-20221-1-20231-2-20231-3-20231-4-20231-5-20231-6-20231-7-2023
22.13.014502-7-20222.13.01606060606060105105105105454545454545000
32.13.028502-7-20222.13.0200055590909090909090858585000
42.13.0390030-9-20222.13.03008080808080801701701701709090909090900
52.13.0420030-10-20222.13.04000000000105105105105105105105105105105
62.13.059503-1-20222.13.05959518518518518518518518518590900000000
72.13.064502-2-20222.13.06045858585858585858585400000000
82.13.078503-5-20222.13.07000601451451451451451451451451458500000
92.13.087504-3-20222.13.08555513013013013013013013013075750000000
102.13.092504-3-20222.13.090025252525255050505050252525252500
112.13.1015031-8-20222.13.100000000151545454545454545453030
122.13.016003-1-2022
132.13.02503-4-2022
142.13.038004-3-2022
152.13.0485030-10-2022
162.13.059004-3-2022
172.13.064004-3-2022
182.13.076003-4-2022
192.13.085503-1-2022
202.13.0925031-8-2022
212.13.1030030-10-2022
Sheet9
Cell Formulas
RangeFormula
F2:X11F2=LET(x,E2:E11,y,F1:X1,MAKEARRAY(ROWS(x),COLUMNS(y),LAMBDA(r,c,SUM((A2:A21=INDEX(x,r))*(C2:C21>=EOMONTH(INDEX(y,1,c),-10)+1)*(C2:C21<=EOMONTH(INDEX(y,1,c),0))*B2:B21))))/10
Dynamic array formulas.
 
Upvote 0
Solution
Right, I read that wrong at first. Try below:

Book1
ABCDEFGHIJKLMNOPQRSTUVWX
1CategoryPriceDate1-1-20221-2-20221-3-20221-4-20221-5-20221-6-20221-7-20221-8-20221-9-20221-10-20221-11-20221-12-20221-1-20231-2-20231-3-20231-4-20231-5-20231-6-20231-7-2023
22.13.014502-7-20222.13.01606060606060105105105105454545454545000
32.13.028502-7-20222.13.0200055590909090909090858585000
42.13.0390030-9-20222.13.03008080808080801701701701709090909090900
52.13.0420030-10-20222.13.04000000000105105105105105105105105105105
62.13.059503-1-20222.13.05959518518518518518518518518590900000000
72.13.064502-2-20222.13.06045858585858585858585400000000
82.13.078503-5-20222.13.07000601451451451451451451451451458500000
92.13.087504-3-20222.13.08555513013013013013013013013075750000000
102.13.092504-3-20222.13.090025252525255050505050252525252500
112.13.1015031-8-20222.13.100000000151545454545454545453030
122.13.016003-1-2022
132.13.02503-4-2022
142.13.038004-3-2022
152.13.0485030-10-2022
162.13.059004-3-2022
172.13.064004-3-2022
182.13.076003-4-2022
192.13.085503-1-2022
202.13.0925031-8-2022
212.13.1030030-10-2022
Sheet9
Cell Formulas
RangeFormula
F2:X11F2=LET(x,E2:E11,y,F1:X1,MAKEARRAY(ROWS(x),COLUMNS(y),LAMBDA(r,c,SUM((A2:A21=INDEX(x,r))*(C2:C21>=EOMONTH(INDEX(y,1,c),-10)+1)*(C2:C21<=EOMONTH(INDEX(y,1,c),0))*B2:B21))))/10
Dynamic array formulas.
Thank you! That seems to work perfectly.

Do you mind explaining how did you came up with that solution? Specially how the lambda function works.
 
Upvote 0
Thank you! That seems to work perfectly.

Do you mind explaining how did you came up with that solution? Specially how the lambda function works.
MAKEARRAY() is an lambda helper function that will take two arguments; any amount of rows and any amount of columns. Therefor I first initialized an x and y variable and used their respective rows and column count as input for these two parameters. The third parameter is the actual lambda that will iterate each junction in the imaginary table of rows and columns. We can use this to reference the right row and column from the initial x and y variables.
 
Upvote 0
MAKEARRAY() is an lambda helper function that will take two arguments; any amount of rows and any amount of columns. Therefor I first initialized an x and y variable and used their respective rows and column count as input for these two parameters. The third parameter is the actual lambda that will iterate each junction in the imaginary table of rows and columns. We can use this to reference the right row and column from the initial x and y variables.
Got it! Thank you again.
Just one more question, using your solution, if I added another collumn called "Paid" for each payment in the database with valuer "Yes/No", how can I make it such as it only considers the "Yes" values?

Book2
ABCD
1CategoryPriceDatePaid
22.13.0145044744Yes
32.13.0285044744Yes
42.13.0390044834No
52.13.0420044864Yes
62.13.0595044564Yes
72.13.0645044594Yes
82.13.0785044684No
92.13.0875044624Yes
102.13.0925044624Yes
112.13.1015044804No
122.13.0160044564Yes
132.13.025044654Yes
142.13.0380044624Yes
152.13.0485044864No
162.13.0590044624Yes
172.13.0640044624Yes
182.13.0760044654No
192.13.0855044564Yes
202.13.0925044804Yes
212.13.1030044864Yes
Sheet1
 
Upvote 0
Got it! Thank you again.
Just one more question, using your solution, if I added another collumn called "Paid" for each payment in the database with valuer "Yes/No", how can I make it such as it only considers the "Yes" values?

Book2
ABCD
1CategoryPriceDatePaid
22.13.0145044744Yes
32.13.0285044744Yes
42.13.0390044834No
52.13.0420044864Yes
62.13.0595044564Yes
72.13.0645044594Yes
82.13.0785044684No
92.13.0875044624Yes
102.13.0925044624Yes
112.13.1015044804No
122.13.0160044564Yes
132.13.025044654Yes
142.13.0380044624Yes
152.13.0485044864No
162.13.0590044624Yes
172.13.0640044624Yes
182.13.0760044654No
192.13.0855044564Yes
202.13.0925044804Yes
212.13.1030044864Yes
Sheet1
You'd include this in the boolean structure:

Excel Formula:
=LET(x,E2:E11,y,F1:X1,MAKEARRAY(ROWS(x),COLUMNS(y),LAMBDA(r,c,SUM((A2:A21=INDEX(x,r))*(C2:C21>=EOMONTH(INDEX(y,1,c),-10)+1)*(C2:C21<=EOMONTH(INDEX(y,1,c),0))*(D2:D21="Yes")*B2:B21))))/10
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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