Sum over an array based on date in row and unique identifier in column

LisaPal

New Member
Hi,

I am looking for a formula to put in cells B2:F7 on Sheet 2.

Notes
- This is a simplified version of the file I am actually working with. The file I am working with has all work-day dates (Mon-Fri) in row 2 on Sheet 1, for 01/01/2021 to 30/06/2022.
- Each Trade Reference is unique, so there are no duplicates.

What I want the formula on Sheet 2 to do, is;
- Look at Sheet 1
- - Sum over B3:R7 for all dates that relate to the relevant month, and the relevant Trade Reference

E.g.
Formula for cell B4 (sheet 2) = find Trade Reference 2 on Sheet 1, and sum up all entries on Sheet 1 that fall between cell B2 and cell C3 on Sheet 2 (i.e. 01/01/21 - 31/01/21).
So here the formula would return all values that appear in cells B4:G4 on Sheet 1 = 1000

Lisa

Attachments

• Sheet1.PNG
17.4 KB · Views: 5
• Sheet2.PNG
11.5 KB · Views: 3

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Fluff

MrExcel MVP, Moderator
Excel Formula:
``=SUMPRODUCT((Sheet1!\$A\$3:\$A\$10=\$A3)*(Sheet1!\$B\$2:\$R\$2>=B\$2)*(Sheet1!\$B\$2:\$R\$2<=EOMONTH(B\$2,0))*(Sheet1!\$B\$3:\$R\$10))``

LisaPal

New Member
Excel Formula:
``=SUMPRODUCT((Sheet1!\$A\$3:\$A\$10=\$A3)*(Sheet1!\$B\$2:\$R\$2>=B\$2)*(Sheet1!\$B\$2:\$R\$2<=EOMONTH(B\$2,0))*(Sheet1!\$B\$3:\$R\$10))``
That is exactly what I was after - I was playing around with SUMPRODUCT for a while but couldn't get the date to work.

Thanks so much Fluff!

Fluff

MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

Replies
1
Views
94
Replies
6
Views
87
Replies
5
Views
100
Replies
5
Views
132
Replies
4
Views
127

1,141,062
Messages
5,704,050
Members
421,325
Latest member
tapete86

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.

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