SUMIF or SUMIFS with Variable Column

neilfleming

New Member
Joined
Jan 26, 2018
Messages
2
I'm trying to SUMIF project staffing allocations over a fixed range of rows but with a variable column depending on the date in that column. I.e., I have a couple of years' worth of staffing data in columns, and a bunch of projects and employees in those rows.

I want to sumif for "Project A" the allocations in column "BQ".

It's a simple SUMIF statement:
=SUMIF('Project Staffing'!$A$5:$A$678,$B26,'Project Staffing'!BQ$5:BQ$678)

Here is the formula that returns precisely the result: 'Project Staffing'!BQ$5:BQ$678
="'Project Staffing'!"&SUBSTITUTE(ADDRESS(1,COLUMN(INDEX('Project Staffing'!$N$4:$DM$4,0,MATCH($L$3-WEEKDAY($L$3,2)+1,'Project Staffing'!$N$4:$DM$4,0))),4),"1","")&"$5"&":"&SUBSTITUTE(ADDRESS(1,COLUMN(INDEX('Project Staffing'!$N$4:$DM$4,0,MATCH($L$3-WEEKDAY($L$3,2)+1,'Project Staffing'!$N$4:$DM$4,0))),4),"1","")&"$678"

Where $L$3 is any date, like Today(), which I then convert to the starting Monday of that particular week.

When I substitute 'Project Staffing'!BQ$5:BQ$678 with the formula above in the SUMIF formula, Excel says there is a problem with the formula and won't even let me leave the formula bar. I can substitute the 'Project Staffing'!BQ$5:BQ$678 actual text into that formula and it works fine.

So, the problem is less the specifics of my formula, and more of how do I use the result as an argument in my SUMIF formula.

Suggestions?

Thanks...Neil
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,148,291
Messages
5,745,892
Members
423,983
Latest member
blackworx

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
Top