"IF" Excel Help (please!)

Soldato
Joined
5 Mar 2007
Posts
2,858
Location
Macclesfield
Hello,

Can anyone tell me why the below isn't working?

=IF(CI5="yes",DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+210),IF(CI5 = “no”,DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+126),IF(CI5=”n/a”,DATE(YEAR(C5),MONTH(C5),DAY(C5)+126),””)))

Any help appreciated...
 
At a first glance, it looks like you need to put the DATE functions into brackets as it doesn't appear to recognise that the IF functions that follow should run as part of the previous function.
Like this: (DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+210))

Try pasting this into a cell on your spreadsheet:
=IF(CI5="yes",(DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+210)),IF(CI5="no",(DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+126)),IF(CI5="n/a",(DATE(YEAR(C5),MONTH(C5),DAY(C5)+126)),"")))
 
Hello,

Thanks for the response, I'd actually found the very bizarre problem. A friend had somehow quotation marks that tripped excel! The top one works, the bottom one doesn't (took me ages to spot it!)

IF(CI5="yes",DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+210),IF(CI5="no",DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+126),IF(CI5="n/a",DATE(YEAR(C5),MONTH(C5),DAY(C5)+126),"1")))

IF(CI5="yes",DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+210),IF(CI5=“no”,DATE(YEAR(CG5),MONTH(CG5),DAY(CG5)+126),IF(CI5=”n/a”,DATE(YEAR(C5),MONTH(C5),DAY(C5)+126),”1”)))

edit since found out the mistake was editing the formula in word! Not my mistake :)
 
Last edited:
Back
Top Bottom