Feb 17, 2024 08:35 AM - edited Feb 17, 2024 08:37 AM
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")
Solved! Go to Solution.
Feb 17, 2024 08:42 PM
Hah no that makes perfect sense. Try this:
IF(
Produce,
IF(
OR(
Produce = "Apple",
Produce = "Grape"
),
"Fruit",
"Vegetable"
)
)
Feb 17, 2024 08:42 PM
Hah no that makes perfect sense. Try this:
IF(
Produce,
IF(
OR(
Produce = "Apple",
Produce = "Grape"
),
"Fruit",
"Vegetable"
)
)
Feb 18, 2024 03:11 AM
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')
Feb 20, 2024 05:28 AM
YES! This is awesome, thank you and have a good one.🏆👨🍳