Let and SUM values

Redlad91

New Member
Joined
Sep 29, 2015
Messages
11
Office Version
  1. 365
Hi,
I previously received some support on the following link Formula Support - Top 10 list using Index and Match, where i was directed to changing my formula to a LET function.

The formula worked fine, but i noticed that it was pulling back multiple values with the same name, Is there anyway that i can add sum into the formula so it pulls through the total for a specific item number. for example, using the same table in the previous question, I want to sum up when a colleague with the same ID has worked multiple hours of overtime.

Data Table
Colleague IDAgeNameDepartmentOvertime Worked
1233326LewisHR5
1233427RyanFinance5
1233326LewisHR2
1233626LisaIT2
1233726JoanneFinance1
1233626LisaIT4
1233923BrianHR3
1234027LukeFinance2
1234126JamesIT2

with my current formula, it would show both values rather than summarising them. for example if i show from the above results, it would appear like this
1233326LewisHR5
1233626LisaIT4
1233326LewisHR2
1233626LisaIT2

Whereas i would want it to show as

1233326LewisHR7
1233626LisaIT6

My current formula is =LET(f,SORT(FILTER(A2:D10,D2:D10="HR"),2,-1),INDEX(f,SEQUENCE(MIN(ROWS(f),15)),{1,2,3,4})) and this is where i want SUM adding into.

I have tried adapting the f at the start and summing in there but can't seem to get it to work.

Thanks in advance for any support
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
You cannot be using the formula you posted as it only looks at 4 columns, not 5 & it's filtering on HR but your results show IT as well.
 
Upvote 0
You cannot be using the formula you posted as it only looks at 4 columns, not 5 & it's filtering on HR but your results show IT as well.
Apologies i was meant to only have HR in the data.

Essentially i'm looking to summarise anything that meets the criteria in the formula, So in this instance the formula would be

=LET(f,SORT(FILTER(A2:D10,D2:D10="HR"),2,-1),INDEX(f,SEQUENCE(MIN(ROWS(f),15)),{1,2,3,4,5}))

So i would want anything that has HR in the Department column and then summarise the overtime column, then sort them in Highest to lowest to get back the below.

1233326LewisHR7
1233626LisaHR6
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEFGHIJK
1Colleague IDAgeNameDepartmentOvertime WorkedNoColleague IDAgeNameDepartment
21233326LewisHR511233923BrianHR8
31233427RyanFinance521233326LewisHR7
41233326LewisHR23
51233626LisaIT2
61233726JoanneFinance1
71233626LisaIT4
81233923BrianHR8
91234027LukeFinance2
101234126JamesIT2
11
Data
Cell Formulas
RangeFormula
G2:K3G2=LET(f,SORT(FILTER(A2:D10,D2:D10="HR"),2,-1),u,UNIQUE(f),SORT(IF(SEQUENCE(,5)<=4,u,SUMIFS(E2:E10,A2:A10,INDEX(u,,1))),5,-1))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,213,490
Messages
6,113,956
Members
448,535
Latest member
alrossman

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