Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2007

Tip: Looking for answers? Try searching our database.

NESTED IF STATEMENT USING DATE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SSJ - 19 Jun 2007 14:01 GMT
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
Mike H - 19 Jun 2007 14:34 GMT
Try

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

Mike

> Hello!
>
[quoted text clipped - 7 lines]
>
> SJ
SSJ - 19 Jun 2007 15:03 GMT
Thank you Mike. With a slight correction it worked.

SJ
> Try
>
[quoted text clipped - 17 lines]
>>
>> SJ
Max - 19 Jun 2007 14:48 GMT
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")))
Signature

Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

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
SSJ - 19 Jun 2007 15:05 GMT
Max,

Your shorter version was what i was looking for!

Thanks

SJ
> As posted, the formula had an error in this part:
> ..if(TEXT(d2),"yyyy")="2006"
[quoted text clipped - 22 lines]
>
> SJ
Max - 19 Jun 2007 15:51 GMT
welcome ..
Signature

Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

> Max,
>
[quoted text clipped - 3 lines]
>
> SJ
Don Guillett - 19 Jun 2007 15:38 GMT
If d2 is a properly formatted date then this works.

=IF(YEAR(D2)>2005,YEAR(D2),"2005 & before")

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.