Skip to main content

Hi there, I am trying to create an If/or formula and got it to work but I can't get the formula to be blank if there's no data in a field. I'm sure that makes no sense. 

Here's an example: Let's say I have a small list of produce in a column. I want to create a formula in a new column to give me the category of produce either as a fruit or as a vegetable. I got the formula to work but if no produce has been selected I'm still seeing "Vegetable" in the formula column and I want it to return a blank value. Any ideas? Here's the example formula. Thanks in advance!

IF(OR({Produce}="Grape",{Produce}="Apple"),"Fruit","Vegetable")

 

Hah no that makes perfect sense.  Try this:

IF(

Produce,

IF(

OR(

Produce = "Apple",

Produce = "Grape"

),

"Fruit",

"Vegetable"

)

)


Hi,
Sometimes, if you list is large, especially when it is somewhere in the table form, you might want to use switch. The last (optional) value is default - when data exists, but such item is absent in list

SWITCH(Produce,

'','',

'Apple','Fruit',

'Grape','Fruit',

'Celery','Vegetasble',

'something unknown')

Hah no that makes perfect sense.  Try this:

IF(

Produce,

IF(

OR(

Produce = "Apple",

Produce = "Grape"

),

"Fruit",

"Vegetable"

)

)


YES!  This is awesome, thank you and have a good one.🏆👨‍🍳


Reply