Simple Problem, Tricky Solution

Craig Peter DG

New Member
Joined
Sep 10, 2016
Messages
33
Office Version
  1. 2013
Hi

My simple problem is that I need to Sum Values in a Table array within a given date range, with a unique identifying criteria. There are about 15 unique criterias and 365 days of separate dates for a years worth of data.

I need Totals by Month for each of the 15 unique identifiers......

This table shows where I want my results to go. These are Expense types.

Problem is, the values in the source data table are date by date by date, and I need those summarised for each Expense type into month by month, so, grouped, as it were. In addition, the expense categories you see in this table below, well in the source data, they run across the page in columns, not down the page in rows as you see here.


Column1Column2Column3Column4Column5Column6Column7Column8Column9Column10Column11Column12Column13Column14
Operating Expenses
Jul-23​
Aug-23​
Sep-23​
Oct-23​
Nov-23​
Dec-23​
Jan-24​
Feb-24​
Mar-24​
Apr-24​
May-24​
Jun-24​
FY TOTAL
BANK/MERCHANT FEESSUM ALL VALUES FOR JULY FOR THIS EXPENSE TYPE$ -
BOOKEEPING SERVICES$ -
COMPLIANCE/REGULATORY$ -
CONSUMABLES (STUDIO SUPPLIES)$ -
DIGITAL SERVICES/WEB HOSTING$ -
EDUCATION/TRAINING$ -
HOME OFFICE SUPPLIES$ -
INSURANCE (INCOME PROTECT)$ -
LAUNDRY$ -
PHONE/INTERNET$ -
POS$ -
POSTAGE/FREIGHT$ -
PPE$ -
PROMO/MARKETING$ -
RENT (COMMERCIAL$ -
REPAIRS/MAINT$ -
SOFTWARE/HARDWARE$ -
SUBS/MEMBERSHIPS$ -
TOOLS & EQUIP$ -
TRAVEL/ACCOM/MEALS$ -
UTILITIES$ -
VEHICLE$ -
Capital Purchases$ -
COMPUTER/TABLET$ -
MACHINE/EQUIP$ -

So i have a Result table with a different layout to the source data table, I need to sum values that appear down columns in the source data, with different date formattting.

Help??????????? Perhaps an Index Match with an embedded Sumifs????

I dont know.

Im using Excel 2013.

Thankyou

Here is a snapshot of the Source data. See how the Expense categories in columns.



Monthly Expenditure - By Expense Category 2023-2024
OPERATING EXPENSESCAPITAL PURCHASES
DateTotal (Incl GSTVEHICLEREPAIRS/MAINTRENT (COMMERCIALPROMO/MARKETINGCONSUMABLES (STUDIO SUPPLIES)HOME OFFICE SUPPLIESPOSDIGITAL SERVICES/WEB HOSTINGPOSTAGE/FREIGHTTOOLS & EQUIPTRAVEL/ACCOM/MEALSPHONE/INTERNETUTILITIESSUBS/MEMBERSHIPSINSURANCE (INCOME PROTECT)EDUCATION/TRAININGBOOKEEPING SERVICESSOFTWARE/HARDWAREBANK/MERCHANT FEESLAUNDRYCOMPLIANCE/REGULATORYPPECOMPUTER/TABLETMACHINE/EQUIP
1/07/2023​
$ 192.90$ 192.90
1/07/2023​
$ 131.05$ 131.05
1/07/2023​
$ 4.85$ 4.85
1/07/2023​
$ 25.00$ 25.00
1/07/2023​
$ 123.20$ 123.20
 
You need to lock the column part at least, if you unlock the row part of the month check part then you need to unlock the row part of the sum range. This is because the sum range needs to be the same size as the month check range. Basically the sum columns and rows need to match the size of the check columns and rows.

Try it as below:
=SUMPRODUCT(--MONTH($A$5:$A174)=MONTH(B$182)*--($C$4:$Z$4=$A183),$C$5:$Z174)
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You need to lock the column part at least, if you unlock the row part of the month check part then you need to unlock the row part of the sum range. This is because the sum range needs to be the same size as the month check range. Basically the sum columns and rows need to match the size of the check columns and rows.

Try it as below:
=SUMPRODUCT(--MONTH($A$5:$A174)=MONTH(B$182)*--($C$4:$Z$4=$A183),$C$5:$Z174)
Hi Georgieboy. Thankyou. I entered the new formula with some further locking of cells and columns. This time, all my N/A errors disappeared. For the first 5 expense categories down Column 1 i got Zero results as in 0, for all data between Jul 23 and Jan 24. All the rest of the remaining 19 Expense categories I got VALUE error. Here is a screenshot. For some reason the formula is not recognising ALL the expense types, and for the 5 that it is recognising, it is giving me a $0 sum value. Any further thoughts would be greatly appreciated.

Thankyou


Column1Column2Column3Column4Column5Column6Column7Column8
Operating Expenses
Jul-23​
Aug-23​
Sep-23​
Oct-23​
Nov-23​
Dec-23​
Jan-24​
BANK/MERCHANT FEES
0​
0​
0​
0​
0​
0​
0​
BOOKEEPING SERVICES
0​
0​
0​
0​
0​
0​
0​
COMPLIANCE/REGULATORY
0​
0​
0​
0​
0​
0​
0​
CONSUMABLES (STUDIO SUPPLIES)
0​
0​
0​
0​
0​
0​
0​
DIGITAL SERVICES/WEB HOSTING
0​
0​
0​
0​
0​
0​
0​
EDUCATION/TRAINING
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
HOME OFFICE SUPPLIES
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
INSURANCE (INCOME PROTECT)
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
LAUNDRY
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
PHONE/INTERNET
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
POS
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
POSTAGE/FREIGHT
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
PPE
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
PROMO/MARKETING
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
RENT (COMMERCIAL
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
REPAIRS/MAINT
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
SOFTWARE/HARDWARE
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
SUBS/MEMBERSHIPS
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
TOOLS & EQUIP
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
TRAVEL/ACCOM/MEALS
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
UTILITIES
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
VEHICLE
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
Capital Purchases
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
COMPUTER/TABLET
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
MACHINE/EQUIP
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
#VALUE!​
 
Upvote 0
See if the below helps, you do need to lock the rows due to the nature of the data.

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1OPERATING EXPENSESCAPITAL PURCHASES
2DateBANK/MERCHANT FEESBOOKEEPING SERVICESCOMPLIANCE/REGULATORYCONSUMABLES (STUDIO SUPPLIES)DIGITAL SERVICES/WEB HOSTINGEDUCATION/TRAININGHOME OFFICE SUPPLIESINSURANCE (INCOME PROTECT)LAUNDRYPHONE/INTERNETPOSPOSTAGE/FREIGHTPPEPROMO/MARKETINGRENT (COMMERCIALREPAIRS/MAINTSOFTWARE/HARDWARESUBS/MEMBERSHIPSTOOLS & EQUIPTRAVEL/ACCOM/MEALSUTILITIESVEHICLECapital PurchasesCOMPUTER/TABLETMACHINE/EQUIP
301/07/2023192.9192.9
401/07/2023131.05131.05100400999
501/07/20234.854.85500
601/07/20232525
701/07/2023123.2123.2
823/09/2023192.9192.9
923/09/2023131.05131.05100400999
1023/09/20234.854.85300500
1123/09/20232525233
1223/09/2023123.2123.2
13
14
15
16
17
18
19
20
21
22
23
24
25
26Operating ExpensesJul-23Aug-23Sep-23Oct-23Nov-23Dec-23Jan-24Feb-24Mar-24Apr-24May-24Jun-24FY TOTAL
27BANK/MERCHANT FEES4770477000000000954
28BOOKEEPING SERVICES0000000000000
29COMPLIANCE/REGULATORY328.80328.8000000000657.6
30CONSUMABLES (STUDIO SUPPLIES)0000000000000
31DIGITAL SERVICES/WEB HOSTING0000000000000
32EDUCATION/TRAINING00300000000000300
33HOME OFFICE SUPPLIES0000000000000
34INSURANCE (INCOME PROTECT)2502500000000050
35LAUNDRY0000000000000
36PHONE/INTERNET0000000000000
37POS1000100000000000200
38POSTAGE/FREIGHT0000000000000
39PPE0000000000000
40PROMO/MARKETING4000400000000000800
41RENT (COMMERCIAL0000000000000
42REPAIRS/MAINT00233000000000233
43SOFTWARE/HARDWARE0000000000000
44SUBS/MEMBERSHIPS623.20623.20000000001246.4
45TOOLS & EQUIP0000000000000
46TRAVEL/ACCOM/MEALS0000000000000
47UTILITIES0000000000000
48VEHICLE0000000000000
49Capital Purchases99909990000000001998
50COMPUTER/TABLET0000000000000
51MACHINE/EQUIP0000000000000
Sheet2
Cell Formulas
RangeFormula
B27:M51B27=SUMPRODUCT(--(MONTH($A$3:$A$20)=MONTH(B$26))*--($B$2:$Z$2=$A27),$B$3:$Z$20)
N27:N51N27=SUM(B27:M27)
 
Upvote 1
Solution
See if the below helps, you do need to lock the rows due to the nature of the data.

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1OPERATING EXPENSESCAPITAL PURCHASES
2DateBANK/MERCHANT FEESBOOKEEPING SERVICESCOMPLIANCE/REGULATORYCONSUMABLES (STUDIO SUPPLIES)DIGITAL SERVICES/WEB HOSTINGEDUCATION/TRAININGHOME OFFICE SUPPLIESINSURANCE (INCOME PROTECT)LAUNDRYPHONE/INTERNETPOSPOSTAGE/FREIGHTPPEPROMO/MARKETINGRENT (COMMERCIALREPAIRS/MAINTSOFTWARE/HARDWARESUBS/MEMBERSHIPSTOOLS & EQUIPTRAVEL/ACCOM/MEALSUTILITIESVEHICLECapital PurchasesCOMPUTER/TABLETMACHINE/EQUIP
301/07/2023192.9192.9
401/07/2023131.05131.05100400999
501/07/20234.854.85500
601/07/20232525
701/07/2023123.2123.2
823/09/2023192.9192.9
923/09/2023131.05131.05100400999
1023/09/20234.854.85300500
1123/09/20232525233
1223/09/2023123.2123.2
13
14
15
16
17
18
19
20
21
22
23
24
25
26Operating ExpensesJul-23Aug-23Sep-23Oct-23Nov-23Dec-23Jan-24Feb-24Mar-24Apr-24May-24Jun-24FY TOTAL
27BANK/MERCHANT FEES4770477000000000954
28BOOKEEPING SERVICES0000000000000
29COMPLIANCE/REGULATORY328.80328.8000000000657.6
30CONSUMABLES (STUDIO SUPPLIES)0000000000000
31DIGITAL SERVICES/WEB HOSTING0000000000000
32EDUCATION/TRAINING00300000000000300
33HOME OFFICE SUPPLIES0000000000000
34INSURANCE (INCOME PROTECT)2502500000000050
35LAUNDRY0000000000000
36PHONE/INTERNET0000000000000
37POS1000100000000000200
38POSTAGE/FREIGHT0000000000000
39PPE0000000000000
40PROMO/MARKETING4000400000000000800
41RENT (COMMERCIAL0000000000000
42REPAIRS/MAINT00233000000000233
43SOFTWARE/HARDWARE0000000000000
44SUBS/MEMBERSHIPS623.20623.20000000001246.4
45TOOLS & EQUIP0000000000000
46TRAVEL/ACCOM/MEALS0000000000000
47UTILITIES0000000000000
48VEHICLE0000000000000
49Capital Purchases99909990000000001998
50COMPUTER/TABLET0000000000000
51MACHINE/EQUIP0000000000000
Sheet2
Cell Formulas
RangeFormula
B27:M51B27=SUMPRODUCT(--(MONTH($A$3:$A$20)=MONTH(B$26))*--($B$2:$Z$2=$A27),$B$3:$Z$20)
N27:N51N27=SUM(B27:M27)
Thankyou Georgieboy. Your solution was amazing and worked across all Rows and Columns in my destination table. I have trouble grasping the concept of SumProduct still, it seems to work like Index Match in some regards am i right in saying that, cause the entire coordinates where the data you need to add. Anyway MANY THANKS, I will study this function in detail now and try to use it more often.

2023-2024 EXPENSE SUMMARY TABLE
Column1Column2Column3Column4Column5Column6Column7Column8Column14
Operating Expenses
Jul-23​
Aug-23​
Sep-23​
Oct-23​
Nov-23​
Dec-23​
Jan-24​
FY TOTAL
BANK/MERCHANT FEES$ -$ -$ 0.37$ 0.95$ 1.40$ -$ -$ 2.72
BOOKEEPING SERVICES$ 123.20$ 123.20$ 123.20$ 246.40$ 250.00$ -$ -$ 866.00
COMPLIANCE/REGULATORY$ -$ -$ -$ 115.00$ 2.50$ 45.10$ -$ 162.60
CONSUMABLES (STUDIO SUPPLIES)$ 287.74$ 248.41$ 418.49$ 8.74$ 390.23$ 46.30$ 157.05$ 1,556.96
DIGITAL SERVICES/WEB HOSTING$ 119.80$ -$ 121.00$ -$ 120.20$ -$ 112.80$ 473.80
EDUCATION/TRAINING$ -$ -$ -$ 75.00$ -$ -$ -$ 75.00
HOME OFFICE SUPPLIES$ -$ 40.70$ 70.80$ 75.80$ 155.08$ -$ -$ 342.38
INSURANCE (INCOME PROTECT)$ -$ 1,648.57$ -$ -$ -$ -$ -$ 1,648.57
LAUNDRY$ -$ -$ -$ -$ -$ -$ -$ -
PHONE/INTERNET$ 36.60$ -$ 15.40$ 20.20$ 16.40$ -$ -$ 88.60
POS$ 50.00$ 25.00$ 25.00$ 30.00$ 30.00$ 30.00$ -$ 190.00
POSTAGE/FREIGHT$ -$ -$ -$ -$ 73.85$ -$ -$ 73.85
PPE$ -$ -$ 312.39$ -$ 42.00$ -$ 39.00$ 393.39
PROMO/MARKETING$ 58.90$ 620.04$ -$ 111.20$ 206.53$ 338.87$ -$ 1,335.54
RENT (COMMERCIAL$ 470.00$ 640.00$ 540.00$ 550.00$ 555.00$ 320.00$ 150.00$ 3,225.00
REPAIRS/MAINT$ 4,468.80$ 7,844.10$ -$ 4,185.18$ 926.65$ 495.00$ -$17,919.73
SOFTWARE/HARDWARE$ -$ -$ -$ -$ -$ -$ -$ -
SUBS/MEMBERSHIPS$ -$ -$ -$ -$ -$ 1,026.00$ -$ 1,026.00
TOOLS & EQUIP$ 479.60$ 52.46$ -$ 438.10$ 482.98$ -$ -$ 1,453.14
TRAVEL/ACCOM/MEALS$ 17.95$ 176.90$ 80.75$ 24.00$ -$ 11.40$ 780.30$ 1,091.30
UTILITIES$ 510.38$ 1,158.43$ 386.23$ -$ 233.01$ 812.25$ -$ 3,100.30
VEHICLE$ -$ 750.00$ -$ -$ 770.39$ 1,428.81$ -$ 2,949.20
Capital Purchases$ -$ -$ -$ -$ -$ -$ -$ -
COMPUTER/TABLET$ -$ -$ -$ 456.95$ -$ -$ -$ 456.95
MACHINE/EQUIP$ 470.00$ -$ -$ -$ -$ -$ -$ 470.00
Total$38,901.03
 
Upvote 0
I like Sumproduct, I have used it for quite a number of years. I have always used it, but less so, now we have the newer functions available in Excel 365.
I started using Excel with the 97-2003 version so it has always been useful.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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