Forum Discussion
ChidiV
Oct 28, 2021Copper Contributor
#SPILL
Hi Everyone, I have this formula =IF([Article Base Code] ="RD*","DAIRY",IF([Article Base Code] ="CS*","PIGS")) I am getting #SPILL ERROR Please help
- Oct 29, 2021
ChidiV Wait!! YOu can't use the wild card match that way in an IF function.
Try it this way:
=IF(COUNTIF([@Article Base Code],"RD*"),"DAIRY",IF(COUNTIF([@Article Base Code],"CS*"),"PIGS"))
PeterBartholomew1
Oct 29, 2021Silver Contributor
Assuming Riny_van_Eekelen has diagnosed the problem correctly and you attempting to propagate a spilt array within a Table (maybe by accident) you have two courses of action open to you.
One is to stay within the table but restrict the Base Code reference to a single value
=SWITCH([@[Article Base Code]],"RD*","Dairy","CS*","Pigs","Blank")
The other is to move the formula away from the table and allow it to generate a spilt array
= SWITCH(Table1[Article Base Code],
"RD*","Dairy",
"CS*","Pigs",
"Blank")
- ChidiVOct 29, 2021Copper ContributorLet me try these
- PeterBartholomew1Oct 29, 2021Silver Contributor
A further thought. Are your codes exactly "RD*" or do they include other characters, e.g. RD123?
If the latter, you will need to use the LEFT function or even SEARCH.