Forum Discussion
fishcultureman
Sep 28, 2021Copper Contributor
IF statement with one set condition and multiple others
In the attached excel sheet. I want to show if a Certificate is required for exporting goods from GB only to the EU or N. Ireland. So basically if goods travel from GB to either the EU or N. Ireland...
- Sep 28, 2021
=IF(AND(A3="GB",OR(B3={"EU","N. Ireland"})),"Yes","No")
PeterBartholomew1
Sep 28, 2021Silver Contributor
If the output from the formula is to be TRUE/FALSE the IF is unnecessary.
= AND(StartingPoint="GB", OR(Destination="EU", Destination= "N. Ireland"))On the other hand, if you are willing to settle for 0/1, the final appearance of the result can be controlled by number formatting without stopping it being referenced from dependent formulae
= (StartingPoint="GB") * OR(Destination={"EU","N. Ireland"})Note: I have chosen to use defined Names to make the formula readable; it makes no difference to the calculation.
SergeiBaklan
Sep 28, 2021Diamond Contributor
For the field "Is Catch Cert required (Y/N)" it's more logical to have an outputs as Yes/No
- PeterBartholomew1Sep 28, 2021Silver ContributorMaybe. In general, I try to avoid text because is is so easy to mistype. Here I wrote to the cell with a name "Required?" and used number formatting so that it reads "Yes/No". If there are dependent formulas, they reference the cell using
= IF(required?, AdditionalResources)
rather than
= IF(required="Yes", AdditionalResources)
I seem to remember your saying you prefer 'IsRequired' for Booleans. Either way documentation is needed to help future maintenance.