Attempting SUMIF across worksheets using INDIRECT and SUMPRODUCT

Rig88

New Member
Joined
Sep 29, 2017
Messages
2
Hi,

I'm trying to SUM cell J4 across a range of worksheets but only SUM if a static date, K4, on the worksheets are equals too or less than today's date. This is my current attempt at getting this formula to work;

=SUMPRODUCT(SUMIF(INDIRECT("'"&O7:O20&"'!K4"),"=<"&I3,INDIRECT("'"&O7:O20&"'!J4")))

I've listed my worksheet names in O7:O20 and I3 has "=TODAY()" in, on the same worksheet I'm trying to sum up these values. I should get a value of £1460.04 back from at least 1 of the cells if this formula was working correctly, but I'm getting a value of £0.00.

I'm currently using Window 7 and Office 2010.
 

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.
Hi,

2 things to take into account:
1. change your formula to this: =SUMPRODUCT(SUMIF(INDIRECT("'"&O7:O20&"'!K4"),"<="&I3,INDIRECT("'"&O7:O20&"'!J4"))) - beware of the small change in the criteria definition.
2. your formula will return a #REF error if the sheets listed in the range O7:O20 will not exist.
 
Upvote 0
Hi,

2 things to take into account:
1. change your formula to this: =SUMPRODUCT(SUMIF(INDIRECT("'"&O7:O20&"'!K4"),"<="&I3,INDIRECT("'"&O7:O20&"'!J4"))) - beware of the small change in the criteria definition.
2. your formula will return a #REF error if the sheets listed in the range O7:O20 will not exist.

Oh my, I can't believe that is all it took to get this formula working, I feel a little bit of shame for overlooking something so simple.

Thank you very much for your time though, I really appreciate it.
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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