Combining SUMIFS with "VLOOKUP alternative" which should return multiple matches

Davidovic

New Member
Joined
Apr 15, 2020
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a log containing time entries from employees. This log does not contain their position (Developer, Project Manager, QA Engineer).
However, I need to provide a report based on the positions. There are multiple Developers and multiple QA Engineers. What I am trying to get in cell I3 is ALL billable hours for ALL Developers.

In the screenshot you can see an example of this setup and what I'm trying to do:

2020-04-15_12h29_43.png


On the left is the log containing Employee's names and logged hours. Then I have a lookup table to get the Position matching the Employee's name. On the right I have my report where I'm trying to do something like this:

=SUMIFS(log_hours;log_billable;1;VLOOKUP(log_employee;lookup_employee_position;2;0);H3)
  • log_hours are the hours to be summed
  • log_billable must be 1, because I only want the billable hours
  • log_employee contains the employee's name. Here is where I'm stuck. I use the employee's name to lookup the position, and that needs to match the position in the report. In the popup window, it actually looks OK, because both the "Criteria_range2" and the "Criteria2" fields show "Developer", so that should be a match. However, when I press "OK", I get the following error:
    2020-04-15_12h33_56.png
What am I doing wrong? Can this work anyway? If not, what would be an alternative solution/formula?

Any help is appreciated!
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Here is the table, copy-pasted, if anyone wants to give it a shot :)

loglookup_employee_positionreport
employeehoursbillableemployeepositionlogged and billable hours per position
Adam
5,00​
1​
AdamDeveloperDeveloper
#VALUE!​
Bob
2,00​
1​
BobProject ManagerProject Manager
Claire
6,00​
1​
ClaireQA EngineerQA Engineer
Dave
4,00​
0​
DaveDeveloper
Eric
3,00​
1​
EricQA Engineer
Adam
3,00​
1​
Bob
6,00​
0​
Claire
3,00​
1​
Dave
5,00​
1​
Adam
4,00​
1​
Eric
2,00​
0​
Bob
3,00​
1​
Claire
4,00​
0​
Eric
6,00​
1​
Dave
2,00​
1​
 
Upvote 0
How about

+Fluff.xlsm
ABCDEFGHI
1loglookup_employee_positionreport
2employeehoursbillableemployeepositionlogged and billable hours per position
3Adam51AdamDeveloperDeveloper19
4Bob21BobProject ManagerProject Manager5
5Claire61ClaireQA EngineerQA Engineer18
6Dave40DaveDeveloper
7Eric31EricQA Engineer
8Adam31
9Bob60
10Claire31
11Dave51
12Adam41
13Eric20
14Bob31
15Claire40
16Eric61
17Dave21
Data
Cell Formulas
RangeFormula
I3:I5I3=SUM(FILTER($B$3:$B$17,(ISNUMBER(MATCH($A$3:$A$17,FILTER($E$3:$E$7,$F$3:$F$7=H3),0)))*($C$3:$C$17=1)))
 
Upvote 0
Thanks @Fluff ! The results in your example are exactly what they should be, so that's great. However, when I enter the formula in my file, I still get the error I showed in my initial post.

Also, how would I add additional criteria in your formula? For the sake of simplicity, I omitted the Date here, as I was trying to deal with the Position first. In the actual report, I'd also need to group by month. I know how to do this using SUMIFS (then I'd just compare the date of the entry with the start/end of the months as an additional criteria. In your Formula, I'm having a hard time understanding how it works and therefore how to adapt.


loglookup_employee_positionreport
employeehoursdatebillableemployeepositionlogged and billable hours per positionJanFebMar
Adam
5,00​
01.01.2020​
1​
AdamDeveloperDeveloper
Bob
2,00​
05.02.2020​
1​
BobProject ManagerProject Manager
Claire
6,00​
09.03.2020​
1​
ClaireQA EngineerQA Engineer
Dave
4,00​
27.01.2020​
0​
DaveDeveloper
Eric
3,00​
13.03.2020​
1​
EricQA Engineer
Adam
3,00​
26.02.2020​
1​
Bob
6,00​
08.01.2020​
0​
Claire
3,00​
01.01.2020​
1​
Dave
5,00​
05.02.2020​
1​
Adam
4,00​
09.03.2020​
1​
Eric
2,00​
27.01.2020​
0​
Bob
3,00​
13.03.2020​
1​
Claire
4,00​
26.02.2020​
0​
Eric
6,00​
08.01.2020​
1​
Dave
2,00​
13.03.2020​
1​

Thanks again!
 
Upvote 0
Lets get the first formula working, before anything else.
Do you have any #VALUE! errors in your data set?
 
Upvote 0
Yeah you're right, first things first.

I'm not getting #VALUE! errors I believe. Since I can't upload files here, here's a share link via wetransfer.com: excel test.xlsx

I hope you're OK with having a look at it.
 
Upvote 0
If you're not getting a #value error, what error are you getting?
 
Upvote 0
See if this alternative formula works, or causes the same problems. Must be array confirmed with Ctrl Shift Enter, otherwise the results will be wrong (42 instead of 19 for the first row).

=SUMPRODUCT(SUMIFS(log_hours;log_billable;1;log_employee;IF($F$3:$F$7=H3;$E$3:$E$7)))
 
Upvote 0
However, when I enter the formula in my file, I still get the error I showed in my initial post.
Are you remembering to substitute ";" formula separators instead of the "," separators in Fluff's formula?
 
Upvote 0

Forum statistics

Threads
1,216,970
Messages
6,133,806
Members
449,834
Latest member
Damien Hartzell

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