Looking for the correct formula (Index, Match?)

Dtex20

Board Regular
Joined
Jan 29, 2018
Messages
50

27-NOV-1827-Nov-1826-NOV-1826-NOV-1825-NOV-1825-NOV-1824-NOV-1824-NOV-1823-NOV-1823-NOV-1822-NOV-1822-NOV-1821-NOV-1821-NOV-1820-NOV-1820-NOV-18
OT INOT OUTOT INOT OUTOT INOT OUTOT INOT OUTOT INOT OUTOT INOT OUTOT INOT OUTOT IN OT OUT
Name11


20

3


65

Name2
25




12



2112



Name3

4
4
2

53
13






Name4








5

76
3



Name514367631512

<tbody>
</tbody>

Hi guys,

I have a table like this, except the dates are a merged cell.

I'm looking for a way to add each person OT IN & OT OUT per month.

For example Name3 OT IN - November = 10

Thanks
 

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.
Anyway if your data looks like as displayed:

=SUMIFS(INDEX($B$3:$Q$7,MATCH("Name3",$A$3:$A$7,0),0),$B$2:$Q$2,"OT IN",$B$1:$Q$1,">="&DATE(2018,11,1),$B$1:$Q$1,"<"&DATE(2018,12,1))
 
Upvote 0
Get rid of the merged cells and do it like you did in post 1 and then you can work with the data properly.
 
Upvote 0
another way with PowerQuery

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type any}, {"Column3", type any}, {"Column4", type any}, {"Column5", type any}, {"Column6", type any}, {"Column7", type any}, {"Column8", type any}, {"Column9", type any}, {"Column10", type any}, {"Column11", type any}, {"Column12", type any}, {"Column13", type any}, {"Column14", type any}, {"Column15", type any}, {"Column16", type any}, {"Column17", type any}}),
    #"Transposed Table" = Table.Transpose(#"Changed Type"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"OT", type text}, {"Name1", Int64.Type}, {"Name2", Int64.Type}, {"Name3", Int64.Type}, {"Name4", Int64.Type}, {"Name5", Int64.Type}}),
    #"Extracted Month Name" = Table.TransformColumns(#"Changed Type1", {{"Date", each Date.MonthName(_), type text}}),
    #"Grouped Rows" = Table.Group(#"Extracted Month Name", {"Date", "OT"}, {{"SUM N1", each List.Sum([Name1]), type number}, {"SUM N2", each List.Sum([Name2]), type number}, {"SUM N3", each List.Sum([Name3]), type number}, {"SUM N4", each List.Sum([Name4]), type number}, {"SUM N5", each List.Sum([Name5]), type number}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Grouped Rows", {"Date", "OT"}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"[/SIZE]

after that use standard PivotTable from QueryTable

PivotTable
AttributeSUM N3
OTOT IN
DateValue
November
10​

where Attribute & OT are filters

without filters

PivotTable
Attribute(All)
OT(All)
DateValue
November
5​
6​
10​
21​
23​
29​
66​
68​
79​
168​
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,356
Messages
6,124,475
Members
449,164
Latest member
Monchichi

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