I need an excel formula to not update a cell if the date is past the last day of that month

tewell53

New Member
Joined
Sep 11, 2018
Messages
9
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a formula that populates the Wodkdate as column headings for each month, each month is a separate worksheet. The formula I am using now is

Excel Formula:
=WORKDAY(D$4,1,Holidays)

Each cell reads the previous cell "D$4" increments by 1 and skips my list of holidays, based on the results from the above formula I have the following formulas"

The day
Excel Formula:
=DAY(J4)
The Day name
Excel Formula:
=TEXT(J4,"DDD")

I want to have a formula that when it reaches the last working day for a month, the first formula populates spaces and not the first working day of the following month.

For example, our last working day in November 2025 is November 26
 

Attachments

  • Last_dayofthe_Month.png
    Last_dayofthe_Month.png
    62 KB · Views: 3

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’).

The newer version of Excel has some cool functions that can eliminate redundancy in formulas and make stuff like this a little easier.
 
Upvote 0
Here is a version that should work on all versions of Excel.

Assuming the D4 is the first cell you type your initial date in, place this formula in E4 and copy across for all columns:
Excel Formula:
=IFERROR(IF(MONTH(WORKDAY(D$4,1))=MONTH(WORKDAY($D$4,1)),WORKDAY(D$4,1),""),"")
And here is the formula for D5, which you can copy across for all cells:
Excel Formula:
=IF(D4<>"",DAY(D4),"")
The formula for row 6 should be fine as-is.
 
Upvote 0
Here is a version that should work on all versions of Excel.

Assuming the D4 is the first cell you type your initial date in, place this formula in E4 and copy across for all columns:
Excel Formula:
=IFERROR(IF(MONTH(WORKDAY(D$4,1))=MONTH(WORKDAY($D$4,1)),WORKDAY(D$4,1),""),"")
And here is the formula for D5, which you can copy across for all cells:
Excel Formula:
=IF(D4<>"",DAY(D4),"")
The formula for row 6 should be fine as-is.
Joe4, Thank you!
 
Upvote 0
You are welcome.
Glad I was able to help!

Obviously, you can add the Holidays argument back to the Workday functions, as needed.
 
Upvote 0
Since you are using a new version of Excel, you can make use of the LET function to shorten the first formula I gave you a little bit:
Excel Formula:
=LET(m,WORKDAY(D$4,1),IFERROR(IF(MONTH(m)=MONTH(WORKDAY($D$4,1)),m,""),""))
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,421
Members
452,913
Latest member
JWD210

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