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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
54,163
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
54,163
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.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,434
Messages
5,511,326
Members
408,842
Latest member
Amuserad

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top