Summing up based on a rather awkward critera

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,047
I need to be able to present 2 figures, 1 is the stat and 1 is the number of bookings, based on an employee. The user can select an employee from a drop down on another sheet, then they should be able to see how much stat in a month and how many bookings in a month

So If the user selects employee3 in the March field it should say 348.82 and for bookings it should say 9

Book1
ABCDEFGHIJKLMNOPQR
5834.4637762.5961778.9916866.5657921.7855791.425
6ClientsStatBookingsClientsStatBookingsClientsStatBookingsClientsStatBookingsClientsStatBookingsClients
7123456
8406074061440621406284063540642
9Employee12.81690141.295771.4084515.63380388.239442.8169018.450704169.52114.2253520001.40845118.563381.4084515.633803
10Employee2000663.053483.1426157.52413163.8867
11Employee3462.4838153.534123.2312109.581358.4824
12Employee4
13Employee5
14Employee6
15Employee7
16Employee8
17MarchMarchMarchMarchAprilApril
Sheet1



I have tried using various different SUMPRODUCT functions but to no avail. Can anyone help on this one please ?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Volatile but functional, expand the ranges to suit and point the descriptive text to the cells with the dropdowns.

Code:
=SUMIF(INDEX(OFFSET($C$6,,MATCH("March",$C$17:$R$17,0)-1,ROWS($C$6:$C$17),COUNTIF($C$17:$R$17,"March")*3),1,0),
"Stat",INDEX(OFFSET($C$6,,MATCH("March",$C$17:$R$17,0)-1,ROWS($C$6:$C$17),COUNTIF($C$17:$R$17,"March")*3),MATCH("Employee3",$A$6:$A$16,0),0))
 
Upvote 0
Forget that suggestion, can be done easily if you tidy up your source data.

First fill in the blanks in row 17, you should have 12 cells with "March", not 4.

Then =SUMPRODUCT(($A$9:$A$16="Employee3")*($C$6:$R$6="Stat")*($C$17:$R$17="March")*C9:R16)

Should suffice.

Didn't work first time i tried it, but realised i had paranthesis wrong.
 
Upvote 0
You could use SUMPRODUCT for "Stat" like this

=SUMPRODUCT((C6:Z6="Stat")*(B17:Y17="March")*(A9:A16="employee3"),C9:Z16)

for Bookings try

=SUMPRODUCT((C6:Z6="Bookings")*(A17:X17="March")*(A9:A16="employee3"),C9:Z16)

Note that I used a different range for the month in the second one.......
 
Upvote 0
Thank you both very much, you have saved me from throwing my screen out the window. I have up till now used the following way when writing the SUMPRODUCT formula

SUMPRODUCT(--($A$9:$A$16="Employee3"),--( etc etc

This was giving me a #VALUE error, which is why I ditched the idea of using the function. Would you be so kind as yo explain the difference between what I was using and how you've solved my problem

Thanking you very much in advance
 
Upvote 0
Remember that in SUMPRODUCT all the ranges need to be the same size and shape.

In a "normal" use of SUMPRODUCT you may have several columns of the same size with different criteria. For that you can use either syntax......but here you have some criteria in rows and some in columns, so multiplying those gives you a "matrix" of the correct size, e.g. in this formula

=SUMPRODUCT((C6:Z6="Stat")*(B17:Y17="March")*(A9:A16="employee3"),C9:Z16)

the red part results in a matrix of 1 and 0 values that is 8 rows long by 24 columns wide, i.e. the same size as C9:Z16
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,681
Members
452,937
Latest member
Bhg1984

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