Forum Discussion
ashlee963
Dec 31, 2020Copper Contributor
Using MS Excel to Calculate Rolling Headcount and Turnover
I have an Excel spreadsheet with columns including: personnel names date started date left (blank cell if still current) duration calculation (=IF( [Date Left] >0, [Date Left] - [Date Started] ...
- Dec 01, 2020
kirkBolton I'm not sure why that isn't working for you because when I opened it the numbers appear correctly. Please note that what Twifoo did was rearrange your lookup table to be in alpha-numerically increasing order (e.g. S1 then S10, ..., S14, then S2 because '1' is before '2' so 'S1...' is before 'S2...'). That said, here are 2 alternative suggestions you could try:
If you have XLOOKUP() I suggest using it:
=SUMPRODUCT(XLOOKUP(D6:J6,$AB$4:$AB$22,$AC$4:$AC$22,0,0))
You could also use INDEX-MATCH combination to force an exact match (I added the IFERROR just in case but since you have data validation you could remove that)
=SUMPRODUCT(INDEX($AC$4:$AC$22,IFERROR(MATCH(D7:J7,$AB$4:$AB$22,0),1)))
HansVogelaar
Dec 31, 2020MVP
1) In H2, enter the following array formula confirmed with Ctrl+Shift+Enter:
=SUMPRODUCT(($B$2:$B$11<=G2)*(IF($C$2:$C$11="",G2,$C$2:$C$11)>=G2))
Fill down.
- ashlee963Dec 31, 2020Copper ContributorWow, thank you so much! This is a huge help!