Forum Discussion
Find duplicates in a range and match corresponding values
Good morning all,
Each Dept. generates different revenue per hour of work. My end goal is to calculate the revenue generated per person per hour worked by weighting each person's revenue per hour against the amount of the hours they worked in each Dept. I understand how to create a weighted average, I can't figure out how to sort the data in a way that I can manipulate it however.
I am trying to take each value in [Name] range, search through [Name] for duplicate values, and retrieve each corresponding value in ranges [Dept.] and [Hours Worked] when duplicates exist. If I could get a result like the one shown below, I could solve the rest of my problem.
Thank you,
Joe
1 Reply
Hi Joseph,
You may use SUMIFS().
To generate list of departments for the person (cell G4)
=IFERROR(INDEX($B$4:$B$13,AGGREGATE(15,6,1/($A$4:$A$13=$F$4)*ROW($A$4:$A$13),COLUMN(A:A))-ROW($A$3)),"")
To sum hours (cell G5)
=SUMIFS($C$4:$C$13,$A$4:$A$13,$F$4,$B$4:$B$13,G$4)
and attached