vijaymehta
New Member
- Joined
- Apr 3, 2010
- Messages
- 14
- Office Version
- 365
- Platform
- Windows
Hi all, I have small projection worksheet which calculates monthly employee cost based out of his start date / end date combination. This ensures I have right cost projection based on expected start/end date, but as data increases, I see noticeable increase in calculation time, which slows down worksheet for any change in date.
I was wondering if there is any better solution to this instead of nested if's and day function.
Thanks in advance.
I was wondering if there is any better solution to this instead of nested if's and day function.
Thanks in advance.
EmpCost.xlsx | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
1 | 31-Dec-21 | 31-Jan-22 | 28-Feb-22 | 31-Mar-22 | 30-Apr-22 | 31-May-22 | 30-Jun-22 | 31-Jul-22 | 31-Aug-22 | 30-Sep-22 | 31-Oct-22 | 30-Nov-22 | 31-Dec-22 | |||||
2 | ||||||||||||||||||
3 | NAME | Salary | START DATE | END DATE | Jan-22 A | Feb-22 F | Mar-22 F | Apr-22 F | May-22 F | Jun-22 F | Jul-22 F | Aug-22 F | Sep-22 F | Oct-22 F | Nov-22 F | Dec-22 F | ||
4 | Employee 1 | 50,000 | 3/15/2022 | 9/28/2022 | - | - | 2,285 | 4,167 | 4,167 | 4,167 | 4,167 | 4,167 | 3,889 | - | - | - | ||
Employee Expenses |
Cell Formulas | ||
---|---|---|
Range | Formula | |
F4:Q4 | F4 | =IF(AND($D4<=E$1+1,$E4>=F$1),$C4/12, IF(AND($D4<=F$1,$D4>E$1+1,$E4>=F$1),(DAY(F$1)-DAY($D4)+1)/DAY(F$1)*$C4/12, IF(AND($D4<=E$1,$E4>E$1,$E4<F$1),(DAY($E4))/DAY(F$1)*$C4/12, IF(AND($D4>E$1,$E4<F$1),(DAY($E4)-DAY($D4)+1)/DAY(F$1)*$C4/12,0)))) |