0

I have a table in SharePoint using InfoPath where I would like to have a Calculated column with a conditional formula based on the values of another column. I have a formula that works:

=IF(OR(MyField="Thing", MyField="Something Else", MyField="Another Thing"}),"Something","Nothing")

But I would like to use an array (as I have in an Excel workbook for a similar table) to look something like this:

=IF(OR(MyField={"Thing","Something Else","Another Thing"}),"Something","Nothing")

Is there a way to simplify the first formula so that I don’t have to write out MyField = 'for each item'?

In my real case, there are 10 items in MyField that I am looking for.

0

You need to do it the hard way

=IF(OR(MyField="1",MyField="2",MyField="3",MyField="4",MyField="5",MyField="6",MyField="7",MyField="8",MyField="9",MyField="10"),"Something","Nothing")
0

If you are very sure those 10 values are unique you can do it with a String comparison:

=IF( 
      ISNUMBER(
                FIND(
                     "Six"
                     ,"OneTwoThreeFourFiveSixSevenEightNineTen"
                    )
              )
      , "Something"
      , "Nothing"
   )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.