Sum values based on two criterias, one horizontal and the other vertical

Rick__

New Member
Joined
Mar 18, 2016
Messages
20
Hi,

I'm sorry to post this as I'm sure someone will be able to answer this in a flash. But I have had a look through the forum and online and still couldn't quite find the answer I was looking for, which is the reason I'm reaching out, thank you in advance.

I'm trying create a formula which will sum a set of values based on two criterias, one which is vertical and the other horizontal, see table below.



A
B
C
D
E
F
1
Name
Dept
01/01/18
02/01/18
03/01/18
2
John
IT
1
2
0
3
Sue
IT
1
0
1
4
Paul
HR
2
0
1
5
Steve
HR
1
1
2

<tbody>
</tbody>

I'm trying to sum the values of a Dept on a certain day, so it will look something like the below table.


Date
IT
HR
01/01/18
2
3
02/01/18
2
1
03/01/18
1
3

<tbody>
</tbody>
 
Aladin, you're a star it worked perfectly thank you again for your support with those formulas.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi, sorry all I have another question which is similar, with my data filled out:-


A
B
C
D
E
F
1
Name
01/01/2018
02/01/2018
03/01/2018
04/01/2018
2
John
H
H
H
H
3
Sue
8
8
8
8
4
Paul
8
8
H
H
5
Steve
8
8
8
8

<tbody>
</tbody>


I would like to only count or sum a certain date range from C1 to E1 below so I get the results of the table below.

Going forward I want to be able to each month to change the date range which will then update the formula.

A
B
C
D
E
1
Date From
02/01/2018
Date To
04/01/2018
2
Name
Hours
H's
3
John
0
3
4
Sue
24
0
5
Paul
8
2
6
Steve
16
0

<tbody>
</tbody>

Thank you in advance
 
Upvote 0

Book1
ABCDE
1Name1/1/20182/1/20183/1/20184/1/2018
2JohnHHHH
3Sue8888
4Paul88HH
5Steve8888
Sheet1



Book1
ABCD
1Date From2/1/2018Date To4/1/2018
2NameHoursH's
3John03
4Sue240
5Paul82
6Steve240
Sheet2


In B3 of Sheet2 enter and copy down:

=SUMIFS(INDEX(Sheet1!$B$2:$E$5,MATCH($A3,Sheet1!$A$2:$A$5,0),0),Sheet1!$B$1:$E$1,">="&B$1,Sheet1!$B$1:$E$1,"<="&D$1)

In C3 of Sheet2 enter and copy down:

=COUNTIFS(INDEX(Sheet1!$B$2:$E$5,MATCH($A3,Sheet1!$A$2:$A$5,0),0),"H",Sheet1!$B$1:$E$1,">="&B$1,Sheet1!$B$1:$E$1,"<="&D$1)
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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