Advanced IF Formula help needed

E

EileenR

Hi,

I would like to create a formula that does the following: calculate the
number of days between dateA and dateb. If the number of days between the 2
are more than 365 then it would return "X". If the number of days are less
than 365 it would return "N2008" if the year in dateA was 2008 or "N2009" if
the year in dateA was 2009. (eg: if dateA was 8-1-2008 it would return
"N2008", if dateA was 3/31/09 it would retun "N2009"
 
J

Jacob Skaria

With your dates in starting date A1 and end date in B1; try the below formula

=IF(B1-A1>365,"X","N" & YEAR(A1))


If this post helps click Yes
 
E

Eduardo

Hi,
=IF(+B2-A2>365,"X",IF(AND(+B2-A2<365,YEAR(A2)=2008),"N2008",IF(AND(+B2-A2<365,YEAR(A2)=2009),"N2009")))
 
D

David Biddulph

You don't need the + signs.
--
David Biddulph

Eduardo said:
Hi,
=IF(+B2-A2>365,"X",IF(AND(+B2-A2<365,YEAR(A2)=2008),"N2008",IF(AND(+B2-A2<365,YEAR(A2)=2009),"N2009")))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top