Need formula to sum data using multiple parameters

excel?

Board Regular
Joined
Sep 14, 2004
Messages
143
Office Version
  1. 365
Platform
  1. Windows
I need to sum my data based by Class (Col A) for each pay type (Row 2) for each week (Row 1). I tried using SUMIFS [=SUMIFS($C$3:$H$30,$A$3:$A$30,100,$C$2:$H$2,"Reg",$C$1:$H$1,6/4/2023)] to sum the data in $C$3:$H$30 based on Class 100 in Col A and Reg in Row 2 and the Date 6/4/2023 in Row 1, but it just returns #VALUE!.

Is there a formula to get the totals for each Class for each pay type for each week without having to have a separate formula for each pay type/week?

1686947432385.png


Essentially, I would like a formula to fill the table below that updates each month when I change the dates.
1686947574962.png


Thank you in advance for any suggestions you can provide.
 

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.
Please re upload your data sample using XL2BB. Cannot manipulate data in a picture and really don't want to recreate what you already have.
 
Upvote 0
A picture isn't very helpful. If you use XL2BB to illustrate your sample data, that can be used in testing for a solution.
 
Upvote 0
Could you use this and expand the ranges accordingly?

021623 Misc.xlsx
ABCDEFGHIJKLM
2regotvacregotvac
3100570.003021001890.001049.000.00
4100750.002001322.83650.00216.00
5100570.00747
6200506.83178
7200816.00472216
Sheet12
Cell Formulas
RangeFormula
K3:M4K3=SUMIF($A$3:$A$7,$J3,C$3:C$7)
 
Upvote 0
Please re upload your data sample using XL2BB. Cannot manipulate data in a picture and really don't want to recreate what you already have.

Thanks - not familiar with XL2BB so here goes:
formula help 06-16-23.xlsx
ABCDEFGH
16/4/20236/4/20236/4/20236/11/20236/11/20236/11/2023
2ClassNameRegOTVacRegOTVac
3100Tom570.00$ 302570.00$ 189
4100James750.00750.00$ 1,024
5100Heather570.00$ 747570.00
6200Denise506.83$ 178506.83$ 510
7200Walter816.00$ 472$ 216816.00$ 343
8300David710.00$ 1,092710.00$ 573
9300Joyce723.61$ 92$ 198723.61$ 77
10300Jennifer570.00550.00
11300Tony776.00776.00$ 399
12400Greg900.00$ 427900.00$ 564
13400Mike794.82$ 535794.82$ 525
14500Sara1,238.00$ 711,238.00
15500Tammy882.80$ 248410.80$ 472
16500Kristin780.00$ 892780.00
17600Jill570.00$ 485570.00
18600Matt570.40$ 258570.40$ 389
19600Ron700.00$ 999700.00$ 352
20600Bob752.80$ 749752.80
21700Paul723.60$ 308723.60
22700Linda886.80886.80
23700Alicia894.80$ 561894.80$ 347
24800Barbara863.60$ 358863.60$ 353
25800Steve1,079.20$ 7511,079.20
26800Kyle760.00760.00$ 50
27900Susan576.55$ 466576.55$ 193$ 162
28900Lara750.00$ 6750.00$ 52$ 133
29900Tyler704.00$ 217704.00$ 205$ 114
30900Pete85.78$ 94085.78
Sheet1
 
Upvote 0
Modifying my previous to relate to your data:

Cell Formulas
RangeFormula
J3:J11J3=UNIQUE(A3:A30)
K3:P11K3=SUMIF($A$3:$A$30,$J3,C$3:C$30)
Dynamic array formulas.
 
Upvote 0
An alternative is with Power Query (Get and Transform Data)

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Transposed Table" = Table.Transpose(Source),
    #"Changed Type" = Table.TransformColumnTypes(#"Transposed Table",{{"Column1", type date}}),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Changed Type", {{"Column1", type text}}, "en-US"),{"Column1", "Column2"},Combiner.CombineTextByDelimiter(":", QuoteStyle.None),"Merged"),
    #"Transposed Table1" = Table.Transpose(#"Merged Columns"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Promoted Headers", {":Class", ":Name"}, "Attribute", "Value"),
    #"Grouped Rows" = Table.Group(#"Unpivoted Other Columns", {":Class", "Attribute"}, {{"Hours", each List.Sum([Value]), type number}}),
    #"Pivoted Column" = Table.Pivot(#"Grouped Rows", List.Distinct(#"Grouped Rows"[Attribute]), "Attribute", "Hours")
in
    #"Pivoted Column"

Book1
ABCDEFGHIJKLMNOP
1Column1Column2Column3Column4Column5Column6Column7Column8:Class6/4/2023:Reg6/4/2023:OT6/11/2023:Reg6/11/2023:OT6/11/2023:Vac6/4/2023:Vac
26/4/20236/4/20236/4/20236/11/20236/11/20236/11/202310018901049.6613201212.79570
3ClassNameRegOTVacRegOTVac2001322.83650.191322.83853.21215.84
4100Tom570302.31570188.853002779.611184.352209.611048.74550198.24
5100James7507501023.944001694.82961.981694.821089.28
6100Heather570747.355705002900.81210.732428.8472
7200Denise506.83178.13506.83510.16002593.22489.962593.2740.57
8200Walter816472.06215.84816343.117001618.4868.742505.2346.95886.8
9300David7101092.39710572.818001942.81109.292702.8402.17760
10300Joyce723.6191.96198.24723.6177.259002116.331629.792116.33450.71408.88
11300Jennifer570550
12300Tony776776398.68
13400Greg900426.57900564.19
14400Mike794.82535.41794.82525.09
15500Sara123870.771238
16500Tammy882.8248.23410.8472
17500Kristin780891.73780
18600Jill570484.76570
19600Matt570.4257.86570.4388.8
20600Ron700998.67700351.77
21600Bob752.8748.67752.8
22700Paul723.6308.19723.6
23700Linda886.8886.8
24700Alicia894.8560.55894.8346.95
25800Barbara863.6358.43863.6352.63
26800Steve1079.2750.861079.2
27800Kyle76076049.54
28900Susan576.55466.18576.55193.49162.32
29900Lara7506.375052.32132.56
30900Tyler704217.31704204.9114
31900Pete85.7894085.78
Sheet1
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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