Oct 28 2021 11:51 PM
Oct 29 2021 12:20 AM - edited Oct 29 2021 12:24 AM
@ChidiV The formula is trying to display a dynamic array. You can't use such a dynamic array formula inside a structured table. If the formula is not inside such a table, some of the cells where the array should be spilt into are not empty. Move them out of the way or move your formula.
Edit: If used inside a dynamic table, try this one:
=IF(@[Article Base Code] ="RD*","DAIRY",IF(@[Article Base Code] ="CS*","PIGS"))
Oct 29 2021 01:57 AM - edited Oct 29 2021 01:58 AM
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")
Oct 29 2021 02:20 AM - edited Oct 29 2021 02:38 AM
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.