Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
edwardpestian
 
Posts: n/a
Default IF statement with Weekends vs. weekdays


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: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539612

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CaptainQuattro
 
Posts: n/a
Default IF statement with Weekends vs. weekdays


edwardpestian Wrote:
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


Edward:

The =WEEKDAY function returns 1 for Sunday through 7 for Saturday.

Therefore formula in K36 should be

=IF(OR(WEEKDAY(R6)5,WEEKDAY(R6)=1),Data!CY8*(1.23 ),Data!CY8*(1.13))


--
CaptainQuattro
------------------------------------------------------------------------
CaptainQuattro's Profile: http://www.excelforum.com/member.php...o&userid=32763
View this thread: http://www.excelforum.com/showthread...hreadid=539612

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Toppers
 
Posts: n/a
Default IF statement with Weekends vs. weekdays

=If(weekday(R6,2)<5,Data!CY8*1.13,Data!CY8*1.23)

"edwardpestian" wrote:


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: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539612


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CaptainQuattro
 
Posts: n/a
Default IF statement with Weekends vs. weekdays


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: http://www.excelforum.com/member.php...o&userid=32763
View this thread: http://www.excelforum.com/showthread...hreadid=539612

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
edwardpestian
 
Posts: n/a
Default IF statement with Weekends vs. weekdays


Thanks all for the help, it's working perfect.

Regards,

EP


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=539612

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WEEKENDS VS. WEEKDAYS TLAngelo Excel Discussion (Misc queries) 7 May 12th 06 05:31 PM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
Recognizing weekends and changing to weekdays in Excel hanauer Excel Discussion (Misc queries) 2 January 8th 05 02:13 AM


All times are GMT +1. The time now is 06:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"