Summarizing data in a table using Sumproduct Sumif Indirect with named ranges and table references

number_cruncher

New Member
Joined
Sep 2, 2016
Messages
6
I am using the table tblSummary below to sum data from other tables in the workbook. All table names are in a named range called nrSheetParameters. Some of the tables have additional columns between each month so [sum range] criteria needs to be the same column name in each table as the column the formula is in. My formula below is working and accurate in the January column, but when i copy it across to the other columns the data from the dat in the Jan column repeats.

FORMULA IN JAN COLUMN =SUMPRODUCT(SUMIF(INDIRECT(nrSheetParameters&"[PRODUCTS]"),tblSummary[@[PRODUCTS]:[PRODUCTS]],INDIRECT(nrSheetParameters&"["&UPPER(TEXT(MONTH(DATEVALUE(tblSummary[[#Headers],[JAN]] & "1")),"MMM"))&"]")))

FORMULA IN FEB COLUMN: =SUMPRODUCT(SUMIF(INDIRECT(nrSheetParameters&"[PRODUCTS]"),tblSummary[@[PRODUCTS]:[PRODUCTS]],INDIRECT(nrSheetParameters&"["&UPPER(TEXT(MONTH(DATEVALUE(tblSummary[[#Headers],[FEB]] & "1")),"MMM"))&"]")))

Why is this happening?? Thanks in advance for any help you can offer :) Cheers!

I am using Microsoft Excel for Mac v16.67

table name: tblSummary
PRODUCTSJANFEBMARAPRMAYJUNJUL
CRATES
510​
510​
510​
510​
510​
510​
510​
CRATE WHEELS
0​
0​
0​
0​
0​
0​
0​
4 WHEELERS
0​
0​
0​
0​
0​
0​
0​
PANEL CARTS
0​
0​
0​
0​
0​
0​
0​
SPEED PK
0​
0​
0​
0​
0​
0​
0​
E-CART
0​
0​
0​
0​
0​
0​
0​
LIBRARY CRT
0​
0​
0​
0​
0​
0​
0​
D- LIBRARY
720​
720​
720​
720​
720​
720​
720​
COOLERS
0​
0​
0​
0​
0​
0​
0​
J-BARS
0​
0​
0​
0​
0​
0​
0​
APPLIANCE DOLLY
0​
0​
0​
0​
0​
0​
0​
PIANO BOARDS
0​
0​
0​
0​
0​
0​
0​
SAFE JACKS (SETS)
0​
0​
0​
0​
0​
0​
0​
LADDERS
0​
0​
0​
0​
0​
0​
0​
KICK BACK DOLLY
0​
0​
0​
0​
0​
0​
0​
SCALE
0​
0​
0​
0​
0​
0​
0​
POLY NIGHT (FT)
0​
0​
0​
0​
0​
0​
0​
PALLET JACK
0​
0​
0​
0​
0​
0​
0​
LIFT TABLE
0​
0​
0​
0​
0​
0​
0​
SILVERWARE
0​
0​
0​
0​
0​
0​
0​
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
How about
Excel Formula:
=SUMPRODUCT(SUMIF(INDIRECT(nrSheetParameters&"[PRODUCTS]"),tblSummary[@[PRODUCTS]:[PRODUCTS]],INDIRECT(nrSheetParameters&"["&tblSummary[[#Headers],[JAN]]&"]")))
 
Upvote 0
Solution
How about
Excel Formula:
=SUMPRODUCT(SUMIF(INDIRECT(nrSheetParameters&"[PRODUCTS]"),tblSummary[@[PRODUCTS]:[PRODUCTS]],INDIRECT(nrSheetParameters&"["&tblSummary[[#Headers],[JAN]]&"]")))
Thank you @Fluff! This worked like a charm! It looks like I over-thought and over-complicated it. The next issue I need to tackle is how to handle errors if any of the tables are missing any of the month columns (like you see in the Jun & Jul columns). Let me know if I need to post this question in a new thread.

table: tblSummary
PRODUCTSJANFEBMARAPRMAYJUNJUL
CRATES
510​
0​
100​
0​
0​
#REF!​
#REF!​
CRATE WHEELS
0​
25​
0​
0​
0​
#REF!​
#REF!​
4 WHEELERS
0​
750​
0​
0​
0​
#REF!​
#REF!​
PANEL CARTS
0​
0​
0​
0​
0​
#REF!​
#REF!​
SPEED PK
0​
0​
0​
0​
0​
#REF!​
#REF!​
E-CART
0​
0​
0​
0​
0​
#REF!​
#REF!​
LIBRARY CRT
0​
0​
0​
0​
0​
#REF!​
#REF!​
D- LIBRARY
720​
0​
200​
0​
0​
#REF!​
#REF!​
COOLERS
0​
0​
0​
0​
0​
#REF!​
#REF!​
J-BARS
0​
0​
0​
0​
0​
#REF!​
#REF!​
APPLIANCE DOLLY
0​
0​
0​
0​
0​
#REF!​
#REF!​
PIANO BOARDS
0​
0​
0​
0​
0​
#REF!​
#REF!​
SAFE JACKS (SETS)
0​
0​
0​
0​
0​
#REF!​
#REF!​
LADDERS
0​
0​
0​
0​
0​
#REF!​
#REF!​
KICK BACK DOLLY
0​
0​
0​
0​
0​
#REF!​
#REF!​
SCALE
0​
0​
0​
0​
0​
#REF!​
#REF!​
POLY NIGHT (FT)
0​
0​
0​
0​
0​
#REF!​
#REF!​
PALLET JACK
0​
0​
0​
0​
0​
#REF!​
#REF!​
LIFT TABLE
0​
75​
0​
0​
0​
#REF!​
#REF!​
SILVERWARE
0​
0​
0​
0​
0​
#REF!​
#REF!​
 
Upvote 0
How about
Excel Formula:
=SUMPRODUCT(SUMIF(INDIRECT(nrSheetParameters&"[PRODUCTS]"),tblSummary[@[PRODUCTS]:[PRODUCTS]],INDIRECT(nrSheetParameters&"["&tblSummary[[#Headers],[JAN]]&"]")))
 
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,123
Members
452,546
Latest member
Rafafa

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