Sum every nth column for x instances (to get a weekly YTD number)

nickcar

New Member
Joined
Jun 6, 2019
Messages
4
Hi, I'm trying to sum every 3rd column up to the current week in order to have a current year to date sum up to our current fiscal week (or any fiscal week chosen). Below is the current setup, any ideas with sumproduct, offset, mod probably make sense but I can't wrap my head around what the combo looks like.

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
YTD as of22FW 01FW 01-2FW 01-3FW 02FW 02-2FW 02-3FW 03FW 03-2FW 03-3FW 04FW 04-2FW 04-3FW 05FW 05-2FW 05-3FW 06FW 06-2FW 06-3
12/31/18 - 12/29/19Jan12/311/6Jan1/71/13Jan1/141/20Jan1/211/27Feb1/282/3Feb2/42/10
PlanActualPlanForecastActualPlanForecastActualPlanForecastActualPlanForecastActualPlanForecastActualPlanForecastActual
#VALUE!1,746.001,035.502,037.003,375.502,037.00627.502,037.002,553.752,932.3913,796.004,126.256,026.00

<colgroup><col style="width: 60px"><col width="60"><col width="60"><col width="21"><col width="21"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>
</tbody>

Ideally i'd type a week number into B2 and that would update both A4 and B4 to reflect Plan and Actual up to that point. As you can see to the right we have each fiscal week with Plan and Actual, so I'd only need to sum every 3rd column up to the (week number) of columns.

Thanks
Nick
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
I can't tell from your illustration which column contains which information.
However, if you want to sum the "Actuals" (in green) values below them:

Code:
=SUMPRODUCT(("Actual" = F4:W4)*F5:W5)

Where in my sheet, the first indication of Plan/Forecast/Actual began in F4 (with Plan), etc.
 
Last edited:
Upvote 0
Thanks kweaver that makes good sense. How would I limit that sumproduct to only the first x number of instances? So only up to week 22 of the 52 fiscal weeks of the year?
 
Upvote 0
In your example you're showing 6 sets of 3 columns (Plan, Forecast, Actual -- repeat).
But I cannot tell from the display if that represents 6 months (Jan, Feb, etc.) or what...so that the 22nd week would be where?
 
Upvote 0
Good question, what I pasted in is only the first 6 weeks of a 52 week year, the rest of the weeks continue in similar columns to the right. Ideally i’d reference a week number and have a YTD sum through that week.
 
Upvote 0
I put the number of weeks (e.g., 3) in C2.
Then, in A5 (below "Plan") I have:

Code:
=SUMPRODUCT(("Plan"=INDIRECT("$F$4:"&(ADDRESS(4,5+3*$C$2))))*INDIRECT("$F$5:"&ADDRESS(5,5+3*$C$2)))

And in B5 (below "Actual") I have:

Code:
=SUMPRODUCT(("Actual"=INDIRECT("$F$4:"&(ADDRESS(4,5+3*$C$2))))*INDIRECT("$F$5:"&ADDRESS(5,5+3*$C$2)))

As I mentioned in a previous post, my blocks of 3 start in F column.
 
Last edited:
Upvote 0
I shifted everything to the left to match what I now figured out are your column references.

Code:
=SUMPRODUCT(("Plan"=INDIRECT("$E$4:"&(ADDRESS(4,4+3*$B$2))))*INDIRECT("$E$5:"&ADDRESS(5,4+3*$B$2)))

The above code now goes into A5 under "Plan"...and the same code would be under "Actual" in B5 but you need to change the "Plan" to "Actual"

Hope this helps.

Kevin
 
Last edited:
Upvote 0
Awesome, yeah, I get it and was playing with it as well. Is there a way to make the cell references in quotes to be dynamic, so that if i dragged that formula down it'd reference it's current row? I used the row() function to do that within the address() function...
 
Upvote 0
Maybe something like this:


Book1
ABCDEFGHIJKLMNOPQRSTU
1YTD as of22FW 01FW 01-2FW 01-3FW 02FW 02-2FW 02-3FW 03FW 03-2FW 03-3FW 04FW 04-2FW 04-3FW 05FW 05-2FW 05-3FW 06FW 06-2FW 06-3
212/31/18 - 12/29/19JanDec-3101-JunJan01-JulJan-13JanJan-14Jan-20JanJan-21Jan-27FebJan-2802-MarFeb02-Apr02-Oct
3PlanActualPlanForecastActualPlanForecastActualPlanForecastActualPlanForecastActualPlanForecastActualPlanForecastActual
41,746.001,035.502,037.003,375.502,037.00627.52,037.002,553.752,932.3913,796.004,126.256,026.00
5
6YTD Total27414.25
Sheet1
Cell Formulas
RangeFormula
C6=SUMPRODUCT(SUMIFS(D4:U4,D3:U3,"Actual",B1:S1,"FW "&TEXT(ROW(A1:INDEX(A:A,B1)),"00")))
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

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