View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default Help with if statement

Did you remember to change your E203 formula to give 2 digits for years and
months? Does your formula look like:
=TEXT(DATEDIF(D203,B203,"y"),"00")&"years,"&TEXT(D ATEDIF(D203,B203,"ym"),"00")&"months"
?
--
David Biddulph


"ck" wrote in message
...
I changed the formula and I am still getting errors...Do I need to change
anything to create the acceptability of a double digit number?

"nita" wrote:

ck, I played with your formula and found that if you use
00years,00months --
create the accepability of a double digit number -- which you will have
since
the months in a year may be a single or a double digit number (0, 1, 2, .
. .
9, 10, 11). Just change the formula to read:

=IF(AND(E203="00years,00months",E203<="00years,03 months"),"0-3",IF(AND(E203"00years,03months",E203<="00years,0 6months"),"3-6",IF(AND(E203"00years,06months",E203<="02years,0 0months"),"6m
- 2y",IF(AND(E203"02years,00months",E203<="99years, 00months"),"Older
than
2",""))))


"ck" wrote:

I have used the following statement, but it is returning an incorrect
result
for some cells. In an cell containing an age of 10 years,
11months..the
formula is returning "6m-2y" when it should say older than 2. It also
does
this for the age 25 years 6 months and 18 years 10 months. Please
help.

=IF(AND(E203="0years,0months",E203<="0years,3mont hs"),"0-3",IF(AND(E203"0years,3months",E203<="0years,6mon ths"),"3-6",IF(AND(E203"0years,6months",E203<="2years,0mon ths"),"6m
- 2y",IF(AND(E203"2years,0months",E203<="99years,0m onths"),"Older than
2",""))))