Help

Re: Statement inside a statement

2962 1
cancel
Showing results for 
Search instead for 
Did you mean: 
martin_kristens
4 - Data Explorer
4 - Data Explorer

I am not sure if the headtline is correct for this matter and sorry for the bad english.
I have a problem.
In the {spiller 1 point} column like to Ask if the colomn {Spil} is “Tættest Pinden” then I like to make formular 1 if it is B i like to make a nother formular. Is that not possible.
Looking forward to hear from someone out there soon.
Br. Martin

12 Replies 12
AlliAlosa
10 - Mercury
10 - Mercury

Hi there!

If I understand correctly, you’ll want to write a formula like this…

IF({Spill} = "Tættest Pinden", 
     Formula1,
     Formula2
)

You’ll need to replace Formula1 and Formula2 with the formulas you want. Happy to help further if you need!

martin_kristens
4 - Data Explorer
4 - Data Explorer

Hi and thanks for your reply. But i still have problem.
Can you help me with this formular:
IF({Spill} = “Tættest Pinden”,
AND({Spiller 2}>{Spiller 1},{Spiller 2}>{Spiller 3},{Spiller 2}>{Spiller 4},{Spiller 2}>{Spiller 5},{Spiller 2}>{Spiller 6},“1”,“0”),
AND({Spiller 1}<{Spiller 2},{Spiller 1}<{Spiller 3},{Spiller 1}<{Spiller 4},{Spiller 1}<{Spiller 5},{Spiller 1}<{Spiller 6},“2”,“4”)
)

Hi there! So sorry it’s taken so long to get back to you. I oddly did not get a notification that you had replied! I made a few corrections to the syntax of your formula… the following will only show a result if {Spill} = “Tættest Pinden”:

IF({Spill} = “Tættest Pinden”,
    IF(
        AND(
            {Spiller 2} > {Spiller 1},
            {Spiller 2} > {Spiller 3},
            {Spiller 2} > {Spiller 4},
            {Spiller 2} > {Spiller 5},
            {Spiller 2} > {Spiller 6}),
        “1”,
    “0”,
    IF(
        AND(
            {Spiller 1} < {Spiller 2},
            {Spiller 1} < {Spiller 3},
            {Spiller 1} < {Spiller 4},
            {Spiller 1} < {Spiller 5},
            {Spiller 1} < {Spiller 6}),
        “2”,
    “4”)
    )
)

I think your syntax is a little off. The way I read Martin’s setup, the first AND collection should be checked if {Spill} contains “Tættest Pinden”. If not, it should check the second AND collection. In your version the first IF never closes before the second one begins, so the second IF function will never be checked. I think this is what it should be:

IF(
    {Spill} = "Tættest Pinden",
    IF(
        AND(
            {Spiller 2} > {Spiller 1},
            {Spiller 2} > {Spiller 3},
            {Spiller 2} > {Spiller 4},
            {Spiller 2} > {Spiller 5},
            {Spiller 2} > {Spiller 6}
        ),
        "1",
        "0"
    ),
    IF(
        AND(
            {Spiller 1} < {Spiller 2},
            {Spiller 1} < {Spiller 3},
            {Spiller 1} < {Spiller 4},
            {Spiller 1} < {Spiller 5},
            {Spiller 1} < {Spiller 6}
        ),
        "2",
        "4"
    )
)
martin_kristens
4 - Data Explorer
4 - Data Explorer

Thank so much for your reply.
Sorry both of you both have tryed to copy both formula both no one works.

martin_kristens
4 - Data Explorer
4 - Data Explorer

WOOOW i just found out that it was the " sign that was transformed to “ so now it could save the fomula… I will test it right away. Thanks again

You are so right. But I can not get it to work anyway. I get 4 no matter what numbers I put in.

Oops! Fixed the quotes above. Not sure why it’s not working. Will test locally if I can, but I might not have time until later.

okay. Can you send the new with the right Quotes, please.