Forum Discussion

RoxanneZiegler's avatar
RoxanneZiegler
Qrew Assistant Captain
2 months ago

Formula help with multiple choices

I thought I saved the one I added so if this is duplicate I apologize, I could not find my original.

I want to have a formula field that says this but the , between Pacific Dunes 2 and [#of people in party}+1*9.63 is turning yellow and I have tried ( ) and,, but I can't get this to work. It tells me its expecting a comma

If(Contains([Salesroom]="Pacific Dunes 1","Pacific Dunes 2", [# of people in party]+1*9.63)

What I would ultimately like is 

If(Contains([Salesroom]="Pacific Dunes 1","Pacific Dunes 2", and GSlandsend [# of people in party]+1*9.63) or If[Saleroom]="Playa Grande" [#ofpeopleinparty]+1*7.81)

that way I only have to have one field instead of 3 fields - I have two of the fields working like this If(([Salesroom])="GS Landsend", [# of people in party]+1*9.63)

But as soon as I add more salesroom it doesn't like it

Thank you so much 

Edit I was wrong its not even multiplying correctly so there is something wrong in the *9.63 or *7.81

Example - column # of people 3 and then plus 1 would be 28.89 but its coming out a weird number of 11.63 ??

I actually got it to add correctly by  If(([Salesroom])="GS Landsend", [# of people in party]*9.63)+9.63

 

8 Replies

  • I am a little confused by the question, you are basically looking to nest multiple ifs together in 1 statement . You want to check value of Salesroom and then decide some calculations against it.

    Correct??

    For your calculation , BODMAS is the way to go essentially it's calculating 3+19.63 , essentially it's doing 3+(1 * 9.63) = 13.63 , your formula will have to become

    If(([Salesroom])="GS Landsend", ([# of people in party]+1)*9.63)

    For your multiple ifs , I like keeping it, in syntax below , easier to read 

    If(
      [Salesroom] = "Pacific Dunes 1", "Pacific Dunes 2",
      [Salesroom] = "GS Landsend", ([# of people in party] + 1) * 9.63,
      [Salesroom] = "Playa Grande", ([# of people in party] + 1) * 7.81
    )

    CONTAINS evaluate TRUE/FALSE , essentially below check if salesroom contains this value or not , if the names are constant = might be better choice that contain

    If(Contains([Salesroom],"Pacific Dunes 1","Pacific Dunes 2")

     

    • RoxanneZiegler's avatar
      RoxanneZiegler
      Qrew Assistant Captain

      I tried this but the coma after Pacific Dunes 2 comes up yellow

      IF(Contains([Salesroom]="Pacific Dunes 1","Pacific Dunes 2",
      [Salesroom]="GS Landsend",([# of people in party]+1)*9.63
      [Salesroom]="Playa Grande",([# of people in party]+1)*7.81

       

      I also did it and still yellow at comma

      IF(Contains([Salesroom]="Pacific Dunes 1","Pacific Dunes 2",
      If(contains([Salesroom]="GS Landsend",([# of people in party]+1)*9.63)
      IF(Contains[Salesroom]="Playa Grande",([# of people in party]+1)*7.81)

      • AdamKrzyzanek's avatar
        AdamKrzyzanek
        Qrew Captain

        What about this:

        IF(
           Contains([Salesroom],"Pacific Dunes 1")
                ,"Pacific Dunes 2"
           ,Contains([Salesroom],"GS Landsend")
               ,([# of people in party]+1)*9.63
           ,Contains([Salesroom],"Playa Grande")
               ,([# of people in party]+1)*7.81
        )

         

  • As above just formula Contains is constructed without '='

    Contains (Text u, Text v)

    So instead of
    If(Contains([Salesroom]="Pacific Dunes 1","Pacific Dunes 2" ...)
    You should use:
    If(Contains([Salesroom],"Pacific Dunes 1"),"Pacific Dunes 2" ...)