Formula to calculate working days date.

Mohammed Masood

New Member
Joined
Jul 28, 2017
Messages
5
Hi Forum,
I am trying to create a formula which will calculate the working days date. If column A is having today's date and yesterday's date then result should be same and If column A is having prior to yesterday's date it should show today's date. Below formula is working correct with weekdays but in case if today is Monday it should show Friday to Monday(including Saturday and Sunday) as same date and prior to Friday Today's date.

I have used =IF(OR(A1=($B$1-1),A1=$B$1),A1,$B$1)

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 314"]
<tbody>[TR]
[TD="align: right"]30-Jul-17[/TD]
[TD="align: right"]05-Aug-17[/TD]
[TD="align: right"]05-Aug-17[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]01-Aug-17[/TD]
[TD][/TD]
[TD="align: right"]05-Aug-17[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]02-Aug-17[/TD]
[TD][/TD]
[TD="align: right"]05-Aug-17[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]03-Aug-17[/TD]
[TD][/TD]
[TD="align: right"]05-Aug-17[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]04-Aug-17[/TD]
[TD][/TD]
[TD="align: right"]04-Aug-17[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]05-Aug-17[/TD]
[TD][/TD]
[TD="align: right"]05-Aug-17[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]


Can you help?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Joe4 Thanks for the rply.
I tried using WORKDAYS and NETWORKDAYS but i am not getting the result what i wanted. I also tried WEEKDAYS formula.
Could you please help me out with this ?
 
Upvote 0
Hi, I will just simplify my query.

'Column A' is having random and repeated dates 'Column B1' is having fixed "Today's date". I require output in 'Column C' as if 'Column A' contains today's date and yesterday's date then it should bring same dates and if 'Column A' contains other dates than it should keep Today's date.

I have used =IF(OR(A1=($B$1-1),A1=$B$1),A1,$B$1)

It
is working correct with weekdays but in case "If Today's date is on Monday it should show Friday to Monday dates (including Saturday and Sunday) as same as "Column A" and other dates should show as Today's date".

Please help on this.
 
Upvote 0
Hi, I will just simplify my query.

'Column A' is having random and repeated dates 'Column B1' is having fixed "Today's date". I require output in 'Column C' as if 'Column A' contains today's date and yesterday's date then it should bring same dates and if 'Column A' contains other dates than it should keep Today's date.

I have used =IF(OR(A1=($B$1-1),A1=$B$1),A1,$B$1)

It
is working correct with weekdays but in case "If Today's date is on Monday it should show Friday to Monday dates (including Saturday and Sunday) as same as "Column A" and other dates should show as Today's date".

Please help on this.
Please help on this.
 
Upvote 0
I think it would be more helpful if you provided some sample data and expected output.

There are tools you can use to post screen images. They are listed in Section B of this link here: http://www.mrexcel.com/forum/board-a...forum-use.html.
Also, there is a Test Here forum on this board that you can use to test out these tools to make sure they are working correctly before using them in your question.

 
Upvote 0
It is working correct with weekdays but in case "If Today's date is on Monday it should show Friday to Monday dates (including Saturday and Sunday) as same as "Column A" and other dates should show as Today's date".

Give this formula a try - if it doesn’t work for you in any circumstances then please detail what doesn’t work and what the expected result should be

=IF(AND(A1>=WORKDAY($B$1,-1),A1< $B$1),A1,$B$1)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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