Weekday1 & 7

Range

Board Regular
Joined
Nov 13, 2010
Messages
140
need help with this formula, basically trying to rep a today as Day 0, yes as day 1, etc. But Sunday & Saturday should not increment.

Currently on a Monday I get

Monday, Day 0
Sunday, Day 0
Saturday Day 0
Friday Day 3 (when it should be day 1).


=IF(WEEKDAY(C32)=1,D33,IF(WEEKDAY(C32)=7,D33,"Day "&($C$33-C32)))
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
This is probably not the most refined way of doing what you want, but it should get you closer to where you want to be. In my example the column full of dates is A.

=IF(OR(WEEKDAY(A1)=1,WEEKDAY(A1)=7,A1=TODAY()),0,-NETWORKDAYS(TODAY()-1,A1,0))
 
Upvote 0
Oh wow, never used networkdays() before. Will have to try and work that out.

Beofre you responded I sort've worked it out and went with


for Day 0
=IF(WEEKDAY(C33)=1,"",IF(WEEKDAY(C33)=7,"",($C$33-C33)))

For Day 1+
=IF(WEEKDAY(C32)=1,E33,IF(WEEKDAY(C32)=7,E33,(E33+1)))
 
Upvote 0
You can simplify that by using the optional parameter for WEEKDAY:

=IF(WEEKDAY(C33,2)>5,"",($C$33-C33))

=IF(WEEKDAY(C32,2)>5,E33,(E33+1))
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,890
Members
452,948
Latest member
Dupuhini

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