• if,and added to nested ifs

    Author
    Topic
    #480661

    Condition 1 If B = “clinic”, then D = C*8
    Condition 2 If B = “clinic”, and E = 1, then D = (C*8)+4
    Condition 3 If B = “work”, then D = C*20
    Condition 4 If B = “showup”, then D =20

    I got for conditions 1,3,4:
    =IF(B30=”clinic”,C30*8,IF(B30=”work”,C30*20,IF(B30=”showup”,20)))
    I got for condition 2:
    =IF(AND(B28=”clinic”,E28=1),(C28*8)+4,C28*8)

    How do I incorporate both/all together?

    Viewing 2 reply threads
    Author
    Replies
    • #1311854

      Skipro,

      This should do it if I got the parens counted right.

      [noparse]
      =if(B30=”work”,B30=C30*2,If(B30=”showup”,20,If(B30=”clinic”,If(E30=1,D30=C30*8+4,C30*8),”Error”)))
      [/noparse] :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

      • #1311860

        Skipro,

        This should do it if I got the parens counted right.

        [noparse]
        =if(B30=”work”,B30=C30*2,If(B30=”showup”,20,If(B30=”clinic”,If(E30=1,D30=C30*8+4,C30*8),”Error”)))
        [/noparse] :cheers:

        Hi retiregeek,

        That won’t work. At the minimum, you need to reduce the formula to:
        =if(B30=”work”,C30*2,If(B30=”showup”,20,If(B30=”clinic”,If(E30=1,D30=C30*8+4,C30*8),”Error”)))

        Cheers,
        Paul Edstein
        [Fmr MS MVP - Word]

    • #1311859

      Alternatively:
      =IF(B30=”work”,C30*2,IF(B30=”showup”,20,IF(B30 =”clinic”,C30*8+(E30=1)*4,”Error”)))

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • #1311877

      Paul,

      Thanks, obviously you think clearer than I in the late/early hours. 😆 :cheers:

      May the Forces of good computing be with you!

      RG

      PowerShell & VBA Rule!
      Computer Specs

    Viewing 2 reply threads
    Reply To: if,and added to nested ifs

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: