Formula for the 4 most recent values related to a date

Nebula2121

New Member
Joined
Apr 1, 2016
Messages
32
Hi.

What is a formula to calculate the sum for the 4 most recent values based on a date value in a cell (E2)? The result that I am looking for is in (E5)


[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Date[/TD]
[TD]Value[/TD]
[TD][/TD]
[TD][/TD]
[TD]Valuation Date[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]04/22/2018[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD]07/22/2019[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]07/22/2018[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]10/22/2018[/TD]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD]Result[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]01/22/2019[/TD]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD]35[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]04/22/2019[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]07/22/2019[/TD]
[TD]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi, Are you looking for something like this:


Book1
ABCDE
1DateValueValuation Date
24/22/201824/22/2019
37/22/20185
410/22/201810Result
51/22/20191030
64/22/20195
77/22/201910
Sheet3
Cell Formulas
RangeFormula
E5=SUMPRODUCT(SUMIF($A$2:$A$7,LARGE(($A$2:$A$7<=$E$2)*(A2:A7),{1,2,3,4}),$B$2:$B$7))
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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