laticsforlife
New Member
- Joined
- Jul 11, 2011
- Messages
- 10
I have the following formula that is part of a larger formula that I wrote but had to split into 3 sections due to the nesting limitations of Excel.
NB for the most part I am forced into using Excel XP from work.
The formula is as follows;
=IF(COUNTIF($N$6:$N$31,1)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,2)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,3)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,4)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,5)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,6)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,7)>Number_allowed,Note,"")))))))
The basic premise on each of 200 identical sheets is that N6:N31 contain 26 football team names (from a pool of 20 different names).
'Number_Allowed' refers to the maximum number of any one club that can be chosen (currently 2).
'Note' is the error message if someone chooses more than the maximum number allowed (it can change from year to year).
The number at the end of each Countif (from 1 through 7) are the Clubs names (and have been referenced elsewhere, i.e.
team Apple = 1
team Banana = 2
and so on up to team 20.
The formula above returns an error message if any of the cells have more than 2 of the 7 clubs searched for, but in 2 other adjacent cells I have similar formulas that do exactly the same for the other 13 clubs.
I cannot nest more than 7 clubs together, hence 3 formulas.
I would really like just one formula that looks for all 20 clubs at once (and one that does not mean me entering any other formulas in any other cells as it makes the whole spreadsheet very large as these 3 formula are currently repeated on 200 sheets).
Can anyone suggest a workaround?
An example is below
N6 = Apples
N7 = Pears
N8 = Grapes
N9 = Apples
N10 = Bananas
N11 = Cherries
N12 = Apples
N13 = Cherries
and so on up to
N31 = Apples
So in the above example 3 x Apples is an error.(it will be very unlikely that there are 2 different errors, and so it doesn't have to identify which item is in error, just that there is one)
NB for the most part I am forced into using Excel XP from work.
The formula is as follows;
=IF(COUNTIF($N$6:$N$31,1)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,2)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,3)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,4)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,5)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,6)>Number_allowed,Note,IF(COUNTIF($N$6:$N$31,7)>Number_allowed,Note,"")))))))
The basic premise on each of 200 identical sheets is that N6:N31 contain 26 football team names (from a pool of 20 different names).
'Number_Allowed' refers to the maximum number of any one club that can be chosen (currently 2).
'Note' is the error message if someone chooses more than the maximum number allowed (it can change from year to year).
The number at the end of each Countif (from 1 through 7) are the Clubs names (and have been referenced elsewhere, i.e.
team Apple = 1
team Banana = 2
and so on up to team 20.
The formula above returns an error message if any of the cells have more than 2 of the 7 clubs searched for, but in 2 other adjacent cells I have similar formulas that do exactly the same for the other 13 clubs.
I cannot nest more than 7 clubs together, hence 3 formulas.
I would really like just one formula that looks for all 20 clubs at once (and one that does not mean me entering any other formulas in any other cells as it makes the whole spreadsheet very large as these 3 formula are currently repeated on 200 sheets).
Can anyone suggest a workaround?
An example is below
N6 = Apples
N7 = Pears
N8 = Grapes
N9 = Apples
N10 = Bananas
N11 = Cherries
N12 = Apples
N13 = Cherries
and so on up to
N31 = Apples
So in the above example 3 x Apples is an error.(it will be very unlikely that there are 2 different errors, and so it doesn't have to identify which item is in error, just that there is one)
Last edited: