Referencing accrued leave value for last last months last working day

ConstantCustard

New Member
Joined
Jul 19, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I have changed contract and the new leave policy is only for working days. Being in the middle east, the weekend is Friday and Saturday, which is why I have used WORKDAY.INTL.

The issue I have is transferring the accrued leave balance from the last working day of the previous month to the starting balance for the next month.
As this is working days, the last working day will change cell reference for each month and year.

I can reference the total accrued leave from the previous month manually as I setup the calendar for each year, however I am hoping there is a smarter way to achieve this

For January the last working day accrued leave is at Y6
I am trying to reference this value in B9 to act as the starting balance for February
As you can see for each month the cell reference for the last working day accrued leave changes.
This is where my knowledge of Excel runs out.

Cell Formulas
RangeFormula
C4,C10,C7C4=DATE($B$1,$B4,1)
D4,D10:Z10,D7D4=WORKDAY.INTL($C4,C$3,"0000110")
E4:Z4E4=WORKDAY.INTL($C4,D3,"0000110")
C6C6=SUM((IF(C5<>$A$3,$A$2)),(IF(C34=$A$3,$A$4)))
D6:Y6,D12:X12,D9:Y9D6=SUM((IF(D5<>$A$3,$A$2)),(IF(D5=$A$3,$A$4)),C6)
E7:Z7E7=WORKDAY.INTL($C7,D3,"0000110")
B9B9=Y6
C9,C12C9=SUM((IF(C8<>$A$3,$A$2)),(IF(C38=$A$3,$A$4)),B9)
B12B12=V9
Cells with Conditional Formatting
CellConditionCell FormatStop If True
U4:Z4Expression=MONTH(U4)<>$B$4textNO
U7:Z7Expression=MONTH(U7)<>$B$7textNO
U10:Z10Expression=MONTH(U10)<>$B$10textNO
C4:Z39Dates OccurringtodaytextNO
C6:Z6,B9:Z9,B12:Z12,B15:Z15,B18:Z18,B21:Z21,B24:Z24,B27:Z27,B30:Z30,B33:Z33,B36:Z36,B39:Z39Cell Value>=10textNO
C6:Z6,B9:Z9,B12:Z12,B15:Z15,B18:Z18,B21:Z21,B24:Z24,B27:Z27,B30:Z30,B33:Z33,B36:Z36,B39:Z39Cell Valuebetween 0 and 1textNO
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Ranges B15 - Z39 are not included. What is in those cells? They seem important? What are the values in cells A2, A3, and A4?
 
Upvote 0
If I understand the need try this formula in cell B9: =MAX( OFFSET(B9, -3, 1, 1, 24) ) to get accrued value for January. Likewise, Copy to B12 to get the value from February.

How do you specify the accrued value from the previous year?
 
Upvote 0
Welcome to the MrExcel board!

Is this the sort of thing you are after? I have also suggested alternatives to some of your other formulas which may simplify and/or make more uniform the formula structures in your worksheet.

Cell Formulas
RangeFormula
C4,C10,C7C4=DATE(B$1,B4,1)
D4:Z4,D10:Z10,D7:Z7D4=LET(d,IFERROR(WORKDAY.INTL(C4,1,"0000110"),0),IF(DAY(d)<C$3,"",d))
C6:Z6,C12:Z12,C9:Z9C6=IF(C4="","",B6+IF(C5=$A$3,$A$4,$A$2))
B9,B12B9=LOOKUP(9^9,C6:Z6)
 
Upvote 0
Solution
If I understand the need try this formula in cell B9: =MAX( OFFSET(B9, -3, 1, 1, 24) ) to get accrued value for January. Likewise, Copy to B12 to get the value from February.

How do you specify the accrued value from the previous year?
Thanks, your formula has done the trick. Last year's balance would be manually placed in B6
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,087
Messages
6,123,050
Members
449,092
Latest member
ikke

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