Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
SSJ SSJ is offline
external usenet poster
 
Posts: 58
Default NESTED IF STATEMENT USING DATE

Hello!

Can some review the following IF statement. The error is stating that there are too many arguments.

=IF((TEXT((D2),"yyyy")="2007"),"2007",if(TEXT(d2), "yyyy")="2006","2006","2005 & Before")



If the year of the date is 2007, state "2007", If the year of the date is 2006, state "2006", otherwise state "2005 & Before"



Thanks in advance



SJ

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,501
Default NESTED IF STATEMENT USING DATE

Try

=IF(TEXT(D2,"yyyy")="2007",2007,IF(TEXT(A13,"yyyy" )="2006",2006,2005 & "
Before"))

Mike

"SSJ" wrote:

Hello!

Can some review the following IF statement. The error is stating that there are too many arguments.

=IF((TEXT((D2),"yyyy")="2007"),"2007",if(TEXT(d2), "yyyy")="2006","2006","2005 & Before")



If the year of the date is 2007, state "2007", If the year of the date is 2006, state "2006", otherwise state "2005 & Before"



Thanks in advance



SJ

  #3   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default NESTED IF STATEMENT USING DATE

As posted, the formula had an error in this part:
...if(TEXT(d2),"yyyy")="2006"

which should have been:
...IF(TEXT(D2,"yyyy")="2006"

As-is, corrected with an additional IF to check that D2 isn't blank:
=IF(D2="","",IF((TEXT((D2),"yyyy")="2007"),"2007", IF(TEXT(D2,"yyyy")="2006","2006","2005
& Before")))

Alternatively, a slightly shorter version which yields the same results:
=IF(D2="","",IF(YEAR(D2)<=2005,"2005 & before",TEXT(D2,"yyyy")))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"SSJ" wrote in message
...
Hello!

Can some review the following IF statement. The error is stating that there
are too many arguments.

=IF((TEXT((D2),"yyyy")="2007"),"2007",if(TEXT(d2), "yyyy")="2006","2006","2005
& Before")

If the year of the date is 2007, state "2007", If the year of the date is
2006, state "2006", otherwise state "2005 & Before"

Thanks in advance



SJ


  #4   Report Post  
Posted to microsoft.public.excel.newusers
SSJ SSJ is offline
external usenet poster
 
Posts: 58
Default NESTED IF STATEMENT USING DATE

Thank you Mike. With a slight correction it worked.

SJ
"Mike H" wrote in message
...
Try

=IF(TEXT(D2,"yyyy")="2007",2007,IF(TEXT(A13,"yyyy" )="2006",2006,2005 & "
Before"))

Mike

"SSJ" wrote:

Hello!

Can some review the following IF statement. The error is stating that
there are too many arguments.

=IF((TEXT((D2),"yyyy")="2007"),"2007",if(TEXT(d2), "yyyy")="2006","2006","2005
& Before")



If the year of the date is 2007, state "2007", If the year of the date is
2006, state "2006", otherwise state "2005 & Before"



Thanks in advance



SJ



  #5   Report Post  
Posted to microsoft.public.excel.newusers
SSJ SSJ is offline
external usenet poster
 
Posts: 58
Default NESTED IF STATEMENT USING DATE

Max,

Your shorter version was what i was looking for!

Thanks

SJ
"Max" wrote in message
...
As posted, the formula had an error in this part:
..if(TEXT(d2),"yyyy")="2006"

which should have been:
..IF(TEXT(D2,"yyyy")="2006"

As-is, corrected with an additional IF to check that D2 isn't blank:
=IF(D2="","",IF((TEXT((D2),"yyyy")="2007"),"2007", IF(TEXT(D2,"yyyy")="2006","2006","2005
& Before")))

Alternatively, a slightly shorter version which yields the same results:
=IF(D2="","",IF(YEAR(D2)<=2005,"2005 & before",TEXT(D2,"yyyy")))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"SSJ" wrote in message
...
Hello!

Can some review the following IF statement. The error is stating that
there are too many arguments.

=IF((TEXT((D2),"yyyy")="2007"),"2007",if(TEXT(d2), "yyyy")="2006","2006","2005
& Before")

If the year of the date is 2007, state "2007", If the year of the date is
2006, state "2006", otherwise state "2005 & Before"

Thanks in advance



SJ






  #7   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default NESTED IF STATEMENT USING DATE

welcome ..
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"SSJ" wrote in message
...
Max,

Your shorter version was what i was looking for!

Thanks

SJ



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
Nested IF statement Teri Excel Worksheet Functions 2 January 30th 07 07:40 PM
Nested IF statement PattiP Excel Worksheet Functions 4 January 23rd 07 11:56 PM
Nested if statement burl_h Excel Worksheet Functions 3 December 16th 06 07:35 PM
Help with a nested IF statement. BM Excel Discussion (Misc queries) 4 August 18th 06 04:36 AM
Nested IF Statement aposatsk Excel Discussion (Misc queries) 3 August 1st 06 05:40 PM


All times are GMT +1. The time now is 03:12 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"