mongkokman91
New Member
- Joined
- Jun 26, 2022
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Hi, I have a table whereby the column headers are dates for hourly pay raises (dummy data) and the row headers refer to types of staff, followed by a start and end date for the contract. Screenshot
for illustration. The contract starts on 2021-11-01 and lasts for three years. What I want to do is compute the weighted average pay rate of each staff type at the end of each contract year.
So SUMPRODUCT number of months btw 2021-11-01 to 2022-04-01, 2022-04-01 to 2022-10-01, etc. (i.e., {5,6,1}) and the corresponding rates {$15, $15.25, $15.5} divided by the sum of {5,6,1}. As I am unable to match SUMPRODUCT, DATEDIF and SUM functions (am I missing any formulas?) to my criteria successfully, I am turning to r/Excel for help. It'll be best if the solution doesn't involve unpivoting the table. The Excel version I'm using for this task doesn't have Power Query and people didn't like seeing the consolidated table in an unpivoted state anyway.
Thanks in advance for any assistance.
for illustration. The contract starts on 2021-11-01 and lasts for three years. What I want to do is compute the weighted average pay rate of each staff type at the end of each contract year.
So SUMPRODUCT number of months btw 2021-11-01 to 2022-04-01, 2022-04-01 to 2022-10-01, etc. (i.e., {5,6,1}) and the corresponding rates {$15, $15.25, $15.5} divided by the sum of {5,6,1}. As I am unable to match SUMPRODUCT, DATEDIF and SUM functions (am I missing any formulas?) to my criteria successfully, I am turning to r/Excel for help. It'll be best if the solution doesn't involve unpivoting the table. The Excel version I'm using for this task doesn't have Power Query and people didn't like seeing the consolidated table in an unpivoted state anyway.
Thanks in advance for any assistance.
Staff/Date | 2021-04-01 | 2021-11-01 | 2022-04-01 | 2022-10-01 | 2022-11-01 | 2023-04-01 | 2023-10-01 | 2024-04-01 | 2024-10-01 |
A | $15.00 | $15.00 | $15.25 | $15.50 | $15.75 | $16.00 | $16.25 | $16.50 | $16.75 |
B | $15.50 | $15.50 | $15.75 | $16.00 | $16.25 | $16.50 | $16.75 | $17.00 | $17.25 |
C | $16.00 | $16.00 | $16.25 | $16.50 | $16.75 | $17.00 | $17.25 | $17.50 | $17.75 |
D | $16.50 | $16.50 | $16.75 | $17.00 | $17.25 | $17.50 | $17.75 | $18.00 | $18.25 |
Start Date | 2021-11-01 | ||||||||
End Date | 2022-11-01 | ||||||||
Staff | A | ||||||||
Get: | {$15, $15.25, $15.5} | ||||||||
2021-04-01 and 2021-11-01 are the same because pay was previously raised on an annual basis so 2022-04-01 | |||||||||