Forum Discussion
dlsneb
Apr 06, 2023Copper Contributor
Formula
I am trying to create a formula that looks at only two cells: A1 and A2. If A1 = "A" or "B" or "C" AND (A2="M" then I want the output to be 2, otherwise 0 OR if A2="H" then I want the output to be 3, otherwise 0, I can't get the logic to work?
If A1="A" or "B" or "C"
AND
(A2="M", 2, 0) OR (A2="H", 3, 0)
=OR(A1={"A","B","C"})*((A2="M")*2+(A2="H")*3)
Or if A1 contains nothing but A, B or C:
=(A2="M")*2+(A2="H")*3
- Detlef_LewinSilver Contributor
=OR(A1={"A","B","C"})*((A2="M")*2+(A2="H")*3)
Or if A1 contains nothing but A, B or C:
=(A2="M")*2+(A2="H")*3
- dlsnebCopper ContributorThank you, it works perfectly. I don't know what function the " * " character does in the equation, I'll have to look that up.
- Detlef_LewinSilver Contributor
* is an operator which can be used instead of AND().
+ is an operator which can be used instead of OR().