I'm looking for an IF statement that basically says the following:
IF R6 = a weekend (Friday,Saturday,Sunday) then K36 = Data!CY8*(1.23)
IF R6 = a weekday (Monday - Thursday) then K36 = Data!CY*(1.13)
I'm not sure how to have it determing the weekends vs weekdays.
Thanks in advance.
EP--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: www.excelforum.com/member.php...oamp;userid=33809
View this thread: www.excelforum.com/showthread...hreadid=539612
edwardpestian Wrote:
gt; I'm looking for an IF statement that basically says the following:
gt;
gt; IF R6 = a weekend (Friday,Saturday,Sunday) then K36 = Data!CY8*(1.23)
gt; IF R6 = a weekday (Monday - Thursday) then K36 = Data!CY*(1.13)
gt;
gt; I'm not sure how to have it determing the weekends vs weekdays.
gt;
gt; Thanks in advance.
gt;
gt; EP
Edward:
The =WEEKDAY function returns 1 for Sunday through 7 for Saturday.
Therefore formula in K36 should be
=IF(OR(WEEKDAY(R6)gt;5,WEEKDAY(R6)=1),Data!CY8*(1.23 ),Data!CY8*(1.13))--
CaptainQuattro
------------------------------------------------------------------------
CaptainQuattro's Profile: www.excelforum.com/member.php...oamp;userid=32763
View this thread: www.excelforum.com/showthread...hreadid=539612=If(weekday(R6,2)lt;5,Data!CY8*1.13,Data!CY8*1.23)
quot;edwardpestianquot; wrote:
gt;
gt; I'm looking for an IF statement that basically says the following:
gt;
gt; IF R6 = a weekend (Friday,Saturday,Sunday) then K36 = Data!CY8*(1.23)
gt; IF R6 = a weekday (Monday - Thursday) then K36 = Data!CY*(1.13)
gt;
gt; I'm not sure how to have it determing the weekends vs weekdays.
gt;
gt; Thanks in advance.
gt;
gt; EP
gt;
gt;
gt; --
gt; edwardpestian
gt; ------------------------------------------------------------------------
gt; edwardpestian's Profile: www.excelforum.com/member.php...oamp;userid=33809
gt; View this thread: www.excelforum.com/showthread...hreadid=539612
gt;
gt;
OK. I learned something.
The optional parameter ,2 changes the day numbers to 1 for Monday
through 7 for Sunday.
You can also use parameter ,3 which makes Monday 0, and Sunday 6--
CaptainQuattro
------------------------------------------------------------------------
CaptainQuattro's Profile: www.excelforum.com/member.php...oamp;userid=32763
View this thread: www.excelforum.com/showthread...hreadid=539612
Thanks all for the help, it's working perfect.
Regards,
EP--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: www.excelforum.com/member.php...oamp;userid=33809
View this thread: www.excelforum.com/showthread...hreadid=539612
- Nov 18 Sat 2006 20:10
IF statement with Weekends vs. weekdays
close
全站熱搜
留言列表
發表留言