How to replace weekend and capture the next business day

kumar1803

Board Regular
Joined
Jan 7, 2015
Messages
110
Hello,

I have a record with dates that included the weekends in there.

I would like to find and replace the weekend days to next business day.

1-Jun-2014
1-Feb-2015
1-Jun-2014
1-Nov-2014
1-Mar-2015
1-Nov-2015
1-Nov-2015
1-Nov-2015
1-Nov-2015
1-Oct-2016
1-Oct-2016
1-Oct-2016
1-Oct-2016
1-May-2016
1-Oct-2017
18-Nov-2018
31-Mar-2019
31-Mar-2019
31-Mar-2019
31-Mar-2019
30-Jun-2019
15-Jan-2017
15-Jan-2017
15-May-2016
15-Dec-2018
15-Sep-2018
15-Dec-2018
15-Jun-2019
15-Jun-2019
1-Mar-2014
1-Feb-2015
1-May-2016
1-Oct-2016
1-Jul-2017
1-Apr-2018
1-Apr-2018
1-Sep-2018
1-Apr-2018
1-Jul-2018
1-Sep-2018
1-Sep-2018
1-Sep-2018
1-Jun-2019
1-Jun-2019
1-Jun-2019
<colgroup><col width="149" style="width: 112pt; mso-width-source: userset; mso-width-alt: 5449;"> <tbody> </tbody>
 

Some videos you may like

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,631
Office Version
365
Platform
Windows
For a date in cell A1, try this formula:
Code:
=IF(WEEKDAY(A1,11)<6,A1,WORKDAY(A1-1,1))
If the day in cell A1 is a weekday, it will return that day. Otherwise, it will return the following Monday.
 

kumar1803

Board Regular
Joined
Jan 7, 2015
Messages
110
Thank you!

The formula works great. However my date format is like this:
20160407
20161017
20151217
20161201
20170418
20180122
20170418
20171208
<colgroup><col width="92" style="width: 69pt; mso-width-source: userset; mso-width-alt: 3364;"> <tbody> </tbody>
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,631
Office Version
365
Platform
Windows
That looks significantly different from your original post.

It does not matter what your date format is, as long as the entries are actually dates, and not text or numbers.
Can you confirm? An easy way to check is to right-click on any cell, select "Format Cells...", go to the Number tab and see which number format is being applied.

If you see those values that you posted and your format is "General" or "Text", you do not have valid date entries.
If they are not entered as actual dates, you will need to convert them to dates. One way is to use Text to Columns.
 

Watch MrExcel Video

Forum statistics

Threads
1,101,936
Messages
5,483,783
Members
407,410
Latest member
catherinejoy

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top