Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default IF formula misbehaving with determining year of an event

In D14 I enter 04/23/2008
in D15 the formula contains
=IF(RIGHT(D14,2)="08","true_value","false_value")

Why is D15 returning "false_value"?
I'd expect "true_value"

Thanks for your help.
Pierre
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 123
Default IF formula misbehaving with determining year of an event

Because you are trying to use the RIGHT function (which is designed to
manipulate a string) with a value; in Excel 4/23/08 is equal to 39561
because it is counting the number of days since 1/1/1900.

Try using YEAR instead of RIGHT:
=IF(YEAR(D14)=2008,true,false)


On Apr 24, 10:01 am, Pierre wrote:
In D14 I enter 04/23/2008
in D15 the formula contains
=IF(RIGHT(D14,2)="08","true_value","false_value")

Why is D15 returning "false_value"?
I'd expect "true_value"

Thanks for your help.
Pierre


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 193
Default IF formula misbehaving with determining year of an event

Reitanos,
Thank you for clarifying. Works fine now.

Pierre

On Apr 24, 9:12*am, Reitanos wrote:
Because you are trying to use the RIGHT function (which is designed to
manipulate a string) with a value; in Excel 4/23/08 is equal to 39561
because it is counting the number of days since 1/1/1900.

Try using YEAR instead of RIGHT:
=IF(YEAR(D14)=2008,true,false)

On Apr 24, 10:01 am, Pierre wrote:



In D14 I enter 04/23/2008
in D15 the formula contains
=IF(RIGHT(D14,2)="08","true_value","false_value")


Why is D15 returning "false_value"?
I'd expect "true_value"


Thanks for your help.
Pierre- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default IF formula misbehaving with determining year of an event

You could try:
=IF(TEXT(A5,"yy")="08","true_value","false_value")

HTH,
Paul




--

"Pierre" wrote in message
...
In D14 I enter 04/23/2008
in D15 the formula contains
=IF(RIGHT(D14,2)="08","true_value","false_value")

Why is D15 returning "false_value"?
I'd expect "true_value"

Thanks for your help.
Pierre



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
Misbehaving Tab cynlee Excel Worksheet Functions 1 April 3rd 08 05:21 PM
need formula 4 %change on both neg and pos movemnt year to year co suesolotel Excel Discussion (Misc queries) 4 January 13th 08 12:19 AM
Variable determining formula natelr Excel Discussion (Misc queries) 2 June 28th 06 12:27 AM
Formula for determining sales commission Doug Excel Worksheet Functions 2 January 3rd 06 09:50 PM
need help with determining a formula Cal Excel Worksheet Functions 2 November 11th 05 01:49 PM


All times are GMT +1. The time now is 11:58 PM.

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"