If function to exclude weekends

UMAKEMESIK

Active Member
Joined
Oct 3, 2005
Messages
378
Hello to all.

I have an if statement that works great but I could not figure out how to not included weekends
so my data does not move on weekends.
I tried workdays and other phrases, but I could not figure out
the correct syntax.


Excluding Holidays would be great as well, but not a priority.

would like to start with weekends first.

so my data only moves on workdsays or business days.


i have these statements

Code:
=IF( C3=TODAY(), D3, "" )
Next cell to the right
Code:
=IF(C3=TODAY()-1, D3, "")
Next cell to the right
Code:
=IF(C3=TODAY()-2, D3, "")

And so on, the if statements in each
cell go on for another two days and they
move the data from left to right as needed.

but , what if my original entry starts on a Friday
then i dont want the data to move until Monday
and that would be
this cell

Code:
=IF(C3=TODAY()-1, D3, "")

thanks for any help in advance
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
question.

on this day
which is 7 business days from the start.

Can i make it freeze here?

=IF(AND(WORKDAY(E6,0)=WORKDAY(TODAY(),-6),G6<>""),G6,"")

ON day 7 I would like this info from F3 to stay here indefinitely.
but i dont want it to show up untill day 7

i tried at the end between "") - putting F3

it shows up on day 7 but immediately.
even before the due date.

I tried to nest part of the code between the "")
and that did not work.

Any thoughts.

thanks again.
 
Upvote 0
I am not sure I follow what you are asking.
Can you walk me through an example with actual data?
 
Upvote 0
Joe,
I enter a project name in F3
on day 1
the code goes into this cell.
=IF(AND(WORKDAY(C3,0)=WORKDAY(TODAY(),0),F3<>""),F3,"")

on the next day the data moves to the next cell
=IF(AND(WORKDAY(C3,0)=WORKDAY(TODAY(),-1),F3<>""),F3,"")
by way of the -1

When the data moved to the next cell
it dissapeared from the first cell because of the "" at the end of the function.

Now on the next day , the data moves again:
=IF(AND(WORKDAY(C3,0)=WORKDAY(TODAY(),-2),F3<>""),F3,"")
by way of the -2

it also disappeared from the previous cell because of the "" at the end.


this goes on for a number of days with each day increasing the negative number.

I would like the data to stop on this day (shown below) and freeze here, dont move on or dont
disappear from the cell.

=IF(AND(WORKDAY(E3,0)=WORKDAY(TODAY(),-6),G3<>""),G3,"")




1598463441246.png
 
Upvote 0
OK, I see now.

I think you just need to add a "<" sign to that last formula like this:
=IF(AND(WORKDAY(C3,0)<=WORKDAY(TODAY(),-6),F3<>""),F3,"")
 
Upvote 0
that worked,
it placed the information in the correct cell.
but it placed it now.

or immediately.

we dont want the information to show up untill day 7

can i move the < to another location?

i will try
 
Upvote 0
Where did you place the formula?
I placed it in column M.

It is only populated if the date in cell C3 is 8/17/2020 or earlier, as we expect (assuming that cell C3 always has a date in it).
 
Upvote 0
it works
the placement of the <

THANK YOU
THANKYOU.

There was an original issue with my
function in column
i fixed and added the <

and it works.

if i add any day 8/17 or earlier
the data stays.

thanks again.
 
Upvote 0
HELLO,
YOu helped me solve our issue and helped develop our sheet we use daily
with this
=IF(AND(WORKDAY(C66,0)=WORKDAY(TODAY(),0),E66<>""),E66,"")

This moves the information daily and avoids weekends on the sheet.

Question:
Can this be changed to move weekly instead of daily.

for example every monday the information would move to the next cell?

Let me know if this is possible.

thanks for your time.
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
Members
449,093
Latest member
Mnur

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