Convert date to number based on a range

0

1

I'm trying to write a formula to convert a date to a number based on which range it falls into, but I keep getting a parse error message. can anyone help? Here's the formula. I want it to work so that, for example, if the date in $F2 was 28/09/2006 it would return a value of 6.

TIA for any help

=IF(AND($F2>="01/09/2016"+0,$F2<="31/08/2015"+0),"19-20",IF(AND($F2>="01/09/2015"+0,$F2<="31/08/2016"+0),"18-19",IF(AND($F2>="01/09/2014"+0,$F2<="31/08/2015"+0),"FS1",IF(AND($F2>="01/09/2013"+0,$F2<="31/08/2014"+0),"FS2",IF(AND($F2>="01/09/2012"+0,$F2<="31/08/2013"+0),"R",IF(AND($F2>="01/09/2011"+0,$F2<="31/08/2012"+0),"1",IF(AND($F2>="01/09/2010"+0,$F2<="31/08/2011"+0),"),"2",IF(AND($F2>="01/09/2009"+0,$F2<="31/08/2010"+0),"3",IF(AND($F2>="01/09/2008"+0,$F2<="31/08/2009"+0),"4",IF(AND($F2>="01/09/2007"+0,$F2<="31/08/2008"+0),"5",IF(AND($F2>="01/09/2006"+0,$F2<="31/08/2007"+0),"6"))))))))))))

Geoff Magee

Posted 2017-01-17T02:10:33.727

Reputation: 1

Answers

0

I think that this shall work:

=IF(AND($F2>="01/09/2016"+0,$F2<="08/31/2015"+0),"19-20",IF(AND($F2>="01/09/2015"+0,$F2<="08/31/2016"+0),"18-19",IF(AND($F2>="01/09/2014"+0,$F2<="08/31/2015"+0),"FS1",IF(AND($F2>="01/09/2013"+0,$F2<="08/31/2014"+0),"FS2",IF(AND($F2>="01/09/2012"+0,$F2<="08/31/2013"+0),"R",IF(AND($F2>="01/09/2011"+0,$F2<="08/31/2012"+0),"1",IF(AND($F2>="01/09/2010"+0,$F2<="08/31/2011"+0),"2",IF(AND($F2>="01/09/2009"+0,$F2<="08/31/2010"+0),"3",IF(AND($F2>="01/09/2008"+0,$F2<="08/31/2009"+0),"4",IF(AND($F2>="01/09/2007"+0,$F2<="08/31/2008"+0),"5",IF(AND($F2>="01/09/2006"+0,$F2<="08/31/2007"+0),"6")))))))))))

I changed from 31/08/2015 to 08/31/2015, and removed the ,") in the middle of the formula that was there with no seeming reason, and removed one extra parenthesis at the end.

Yisroel Tech

Posted 2017-01-17T02:10:33.727

Reputation: 4 307

Thanks for your help. I removed the ,") that you pointed out and kept the dates in the UK format. Everything works perfectly. – Geoff Magee – 2017-01-17T03:36:26.317

Great! (I'm in the US so this date format gave a #VALUE! error). If my answer helped you can mark my answer as the correct answer. – Yisroel Tech – 2017-01-17T03:38:02.843