<tbody>
[TD="class: xl63"]Match Date Index[/TD]
[TD="class: xl66"]Team Index[/TD]
[TD="class: xl70, width: 82"]Date[/TD]
[TD="class: xl63, width: 82"]Team ID[/TD]
[TD="class: xl63, width: 82"]Yellow Card[/TD]
[TD="class: xl71, width: 82"]Red Card[/TD]
[TD="class: xl68, width: 96"]Was there a card for that team that date[/TD]
[TD="class: xl63, width: 137"]Did the last match in which they got a card feature a red card[/TD]
[TD="class: xl64"]1[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl72"]20/03/2016[/TD]
[TD="class: xl64"]15964961[/TD]
[TD="class: xl64"]TRUE[/TD]
[TD="class: xl73"]FALSE[/TD]
[TD="class: xl69"]TRUE[/TD]
[TD="class: xl65"]-[/TD]
[TD="class: xl64"]2[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl72"]09/04/2016[/TD]
[TD="class: xl64"]15964961[/TD]
[TD="class: xl64"]FALSE[/TD]
[TD="class: xl73"]TRUE[/TD]
[TD="class: xl69"]TRUE[/TD]
[TD="class: xl64"]FALSE[/TD]
[TD="class: xl64"]3[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl72"]20/04/2016[/TD]
[TD="class: xl64"]15964961[/TD]
[TD="class: xl64"]TRUE[/TD]
[TD="class: xl73"]FALSE[/TD]
[TD="class: xl69"]TRUE[/TD]
[TD="class: xl64"]TRUE[/TD]
[TD="class: xl64"]4[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl72"]09/05/2016[/TD]
[TD="class: xl64"]15964961[/TD]
[TD="class: xl64"]FALSE[/TD]
[TD="class: xl73"]TRUE[/TD]
[TD="class: xl69"]TRUE[/TD]
[TD="class: xl64"]FALSE[/TD]
[TD="class: xl64"]5[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl72"]09/06/2016[/TD]
[TD="class: xl64"]15964961[/TD]
[TD="class: xl64"]FALSE[/TD]
[TD="class: xl73"]TRUE[/TD]
[TD="class: xl69"]TRUE[/TD]
[TD="class: xl64"]TRUE[/TD]
[TD="class: xl64"]6[/TD]
[TD="class: xl67"]1[/TD]
[TD="class: xl72"]09/07/2016[/TD]
[TD="class: xl64"]15964961[/TD]
[TD="class: xl64"]FALSE[/TD]
[TD="class: xl73"]TRUE[/TD]
[TD="class: xl69"]TRUE[/TD]
[TD="class: xl64"]TRUE[/TD]
</tbody>
The last column is the column with the complex formula that is behaving unpredictably
Here is another example of what the data could look like and the formula needs to be able to handle, plus the answers it should be getting
<colgroup><col style="mso-width-source:userset;mso-width-alt:2998; width:62pt" width="82" span="6"> <col style="mso-width-source:userset;mso-width-alt:3510;width:72pt" width="96"> <col style="mso-width-source:userset;mso-width-alt:5010;width:103pt" width="137"> </colgroup><tbody>
[TD="class: xl65, width: 82"]Match Date Index[/TD]
[TD="class: xl68, width: 82"]Team Index[/TD]
[TD="class: xl72, width: 82"]Date[/TD]
[TD="class: xl65, width: 82"]Team ID[/TD]
[TD="class: xl65, width: 82"]Yellow Card[/TD]
[TD="class: xl73, width: 82"]Red Card[/TD]
[TD="class: xl70, width: 96"]Was there a card for that team that date[/TD]
[TD="class: xl65, width: 137"]Did the last match in which they got a card feature a red card[/TD]
[TD="class: xl76"]1[/TD]
[TD="class: xl77"]1[/TD]
[TD="class: xl78"]07/02/2013[/TD]
[TD="class: xl76"]15964961[/TD]
[TD="class: xl76"]TRUE[/TD]
[TD="class: xl79"]FALSE[/TD]
[TD="class: xl80"]TRUE[/TD]
[TD="class: xl67"]-[/TD]
[TD="class: xl81"]1[/TD]
[TD="class: xl82"]2[/TD]
[TD="class: xl83"]07/02/2013[/TD]
[TD="class: xl81"]689786[/TD]
[TD="class: xl81"]TRUE[/TD]
[TD="class: xl84"]FALSE[/TD]
[TD="class: xl85"]TRUE[/TD]
[TD="class: xl67"]-[/TD]
[TD="class: xl86"]1[/TD]
[TD="class: xl87"]3[/TD]
[TD="class: xl88"]07/02/2013[/TD]
[TD="class: xl86"]9700024[/TD]
[TD="class: xl86"]TRUE[/TD]
[TD="class: xl89"]FALSE[/TD]
[TD="class: xl90"]TRUE[/TD]
[TD="class: xl67"]-[/TD]
[TD="class: xl66"]1[/TD]
[TD="class: xl69"]4[/TD]
[TD="class: xl74"]07/02/2013[/TD]
[TD="class: xl66"]7846321[/TD]
[TD="class: xl66"]TRUE[/TD]
[TD="class: xl75"]TRUE[/TD]
[TD="class: xl71"]TRUE[/TD]
[TD="class: xl67"]-[/TD]
[TD="class: xl76"]2[/TD]
[TD="class: xl77"]1[/TD]
[TD="class: xl78"]14/06/2015[/TD]
[TD="class: xl76"]15964961[/TD]
[TD="class: xl76"]TRUE[/TD]
[TD="class: xl79"]FALSE[/TD]
[TD="class: xl80"]TRUE[/TD]
[TD="class: xl66"]FALSE[/TD]
[TD="class: xl81"]2[/TD]
[TD="class: xl82"]2[/TD]
[TD="class: xl83"]14/06/2015[/TD]
[TD="class: xl81"]689786[/TD]
[TD="class: xl81"]TRUE[/TD]
[TD="class: xl84"]FALSE[/TD]
[TD="class: xl85"]TRUE[/TD]
[TD="class: xl66"]FALSE[/TD]
[TD="class: xl86"]2[/TD]
[TD="class: xl87"]3[/TD]
[TD="class: xl88"]14/06/2015[/TD]
[TD="class: xl86"]9700024[/TD]
[TD="class: xl86"]FALSE[/TD]
[TD="class: xl89"]TRUE[/TD]
[TD="class: xl90"]TRUE[/TD]
[TD="class: xl66"]FALSE[/TD]
[TD="class: xl66"]2[/TD]
[TD="class: xl69"]4[/TD]
[TD="class: xl74"]14/06/2015[/TD]
[TD="class: xl66"]7846321[/TD]
[TD="class: xl66"]FALSE[/TD]
[TD="class: xl75"]FALSE[/TD]
[TD="class: xl71"]FALSE[/TD]
[TD="class: xl66"]TRUE[/TD]
[TD="class: xl76"]3[/TD]
[TD="class: xl77"]1[/TD]
[TD="class: xl78"]31/01/2018[/TD]
[TD="class: xl76"]15964961[/TD]
[TD="class: xl76"]FALSE[/TD]
[TD="class: xl79"]FALSE[/TD]
[TD="class: xl80"]FALSE[/TD]
[TD="class: xl66"]FALSE[/TD]
[TD="class: xl81"]3[/TD]
[TD="class: xl82"]2[/TD]
[TD="class: xl83"]31/01/2018[/TD]
[TD="class: xl81"]689786[/TD]
[TD="class: xl81"]FALSE[/TD]
[TD="class: xl84"]TRUE[/TD]
[TD="class: xl85"]TRUE[/TD]
[TD="class: xl66"]FALSE[/TD]
[TD="class: xl86"]3[/TD]
[TD="class: xl87"]3[/TD]
[TD="class: xl88"]31/01/2018[/TD]
[TD="class: xl86"]9700024[/TD]
[TD="class: xl86"]TRUE[/TD]
[TD="class: xl89"]TRUE[/TD]
[TD="class: xl90"]TRUE[/TD]
[TD="class: xl66"]TRUE[/TD]
[TD="class: xl66"]3[/TD]
[TD="class: xl69"]4[/TD]
[TD="class: xl74"]31/01/2018[/TD]
[TD="class: xl66"]7846321[/TD]
[TD="class: xl66"]TRUE[/TD]
[TD="class: xl75"]FALSE[/TD]
[TD="class: xl71"]TRUE[/TD]
[TD="class: xl66"]TRUE
[/TD]
</tbody>
e.g. Team 4, Match Day 3
That game on 07/02/2013 did feature a red card. So the answer is TRUE
The problem is that sometimes when I run the spreadsheet it gives the right answers. Other times it gives the wrong answer in places despite the inputs being the same.
Plus if you go to Evaluate Formula it gives a different answer (the correct answer) to the answer displayed on screen.
Plus the wrong answers seem to change back to being correct if you go into the cell and press enter
**Calculation mode is set to Automatic and the error checking doesn't show any circular references
I've setup a similar formula on a fresh spreadsheet and it is still showing this unpredictable behaviour