#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 454
Default IF Q

How do I say the following

=IF(B8=Thursday,2,0) i.e. Return the value 2 if B8 returns
"Thursday"

Where B8 is a date but it is formatted to show the day


Thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default IF Q

One way:

=IF(WEEKDAY(B8)=5,2,0)

HTH,
Paul


--

"Sean" wrote in message
ups.com...
How do I say the following

=IF(B8=Thursday,2,0) i.e. Return the value 2 if B8 returns
"Thursday"

Where B8 is a date but it is formatted to show the day


Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default IF Q

"Sean" wrote...
How do I say the following

=IF(B8=Thursday,2,0) i.e. Return the value 2 if B8 returns
"Thursday"

Where B8 is a date but it is formatted to show the day


=IF(TEXT(B8,"ddd")="Thu",2,0)

or

=IF(WEEKDAY(B9,2)=4,2,0)


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default IF Q

How do I say the following

=IF(B8=Thursday,2,0) i.e. Return the value 2 if B8 returns
"Thursday"

Where B8 is a date but it is formatted to show the day


=IF(TEXT(B8,"ddd")="Thu",2,0)

or

=IF(WEEKDAY(B9,2)=4,2,0)


I'm surprised you didn't offer these alternatives...

=2*(TEXT(B9,"ddd")="Thu")

=2*(WEEKDAY(B9,2)=4)

<g

Why, by the way, did you opt to use the 2nd argument in the WEEKDAY function
call instead of the simpler single-argument form of this function?

Rick

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default IF Q

"Rick Rothstein \(MVP - VB\)" wrote...
....
Why, by the way, did you opt to use the 2nd argument in the WEEKDAY
function call instead of the simpler single-argument form of this
function?


Because the OP has a UK e-mail address, and I'm not sure anyone
outside the US thinks of Sunday as the 1st day of the week. That is, I
was guessing the OP would find it more obvious to think of Thursday as
the 4th day of the week.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default IF Q

Because the OP has a UK e-mail address, and I'm not sure anyone
outside the US thinks of Sunday as the 1st day of the week. That is, I
was guessing the OP would find it more obvious to think of Thursday as
the 4th day of the week.



Don't know if that is true for UK, in Sweden the week starts with Monday,
another thing is that it is easier for instance to use as a criteria e.g.


=WEEKDAY(A1,2)<6

is simpler than

=AND(WEEKDAY(A1)1,WEEKDAY(A1)<7)


--
Regards,

Peo Sjoblom



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default IF Q

Why, by the way, did you opt to use the 2nd argument in the WEEKDAY
function call instead of the simpler single-argument form of this
function?


Because the OP has a UK e-mail address, and I'm not sure anyone
outside the US thinks of Sunday as the 1st day of the week. That is, I
was guessing the OP would find it more obvious to think of Thursday as
the 4th day of the week.


Ah! That is interesting. Not having an international background myself, it
never occurred to me that other countries might start their calendar week
with Monday instead of Sunday. That would probably be the explanation, then,
between the Sunday/Monday start of week options on those date functions
offering a start-of-week option... I just figured the option was there for
company workweek usage only, not for general calendar use. You learn
something new every day. Thanks Harlan.

Rick

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default IF Q

Try: =IF(TEXT(B8,"dddd")="Thursday",2,0)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Sean" wrote:
How do I say the following

=IF(B8=Thursday,2,0) i.e. Return the value 2 if B8 returns
"Thursday"

Where B8 is a date but it is formatted to show the day


Thanks


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default IF Q

=(WEEKDAY(A1)=5)*2


"Sean" wrote:

How do I say the following

=IF(B8=Thursday,2,0) i.e. Return the value 2 if B8 returns
"Thursday"

Where B8 is a date but it is formatted to show the day


Thanks


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



All times are GMT +1. The time now is 06:47 PM.

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

About Us

"It's about Microsoft Excel"