Forum Discussion

katie's avatar
katie
Brass Contributor
Sep 27, 2017
Solved

Attention Master Excel Slayers:

Platform: MS Excel 2000

 

I don't even know if this is possible, but I know if it is, y'all will be the ones to make it happen. :)

 

I need a formula created for column J Other Comm:

 

1. If B Dealer_No is 112, J should be blank

 

2. Multiply H Pricefully by 5% if F Model is anything but CM-3000 or CM-4000; if it is CM-3000 or CM-4000, leave J blank

 

3. If N HardwareLinkSNO starts with 30 or 40, J should be blank

 

4. Disregard rules 2 & 3 if B Dealer_No is 305, 308, 311, 312, 313, or 350. For these specific dealer numbers, H Pricefully should be multiplied by 10%, regardless of Model or HardwareLinkSNO

 

5. If there is an amount in the J column, and there is “INV” in column G MAStat, it puts INV in J instead of amount; If no amount, leave blank

 

  • When better to start from the end (for cell J2)

    =IF(
       AND(LEN(
       <previous rules>
       )>1,
          ISNUMBER(SEARCH("INV",$G2))),
       "INV",
       <previous rules>
    )
     

    where <pervious rules> are

    =IF($B2=112,
       "",
       IF(
          OR(
             LEFT($B2,3)="305",
             LEFT($B2,3)="308",
             LEFT($B2,3)="311",
             LEFT($B2,3)="312",
             LEFT($B2,3)="313",
             LEFT($B2,3)="350"
          ), $H2*10%,
          IF(
             OR(
                LEFT($N2,2)="30",
                LEFT($N2,2)="40"
             ),"",
             IF(
                OR($F2="CM-3000",$F2="CM-4000"),
                "",
                $H2*5%
             )
          )
       )
    )

    and finally

    =IF(
       AND(LEN(
       IF($B2=112,
       "",
       IF(
          OR(
             LEFT($B2,3)="305",
             LEFT($B2,3)="308",
             LEFT($B2,3)="311",
             LEFT($B2,3)="312",
             LEFT($B2,3)="313",
             LEFT($B2,3)="350"
          ), $H2*10%,
          IF(
             OR(
                LEFT($N2,2)="30",
                LEFT($N2,2)="40"
             ),"",
             IF(
                OR($F2="CM-3000",$F2="CM-4000"),
                "",
                $H2*5%
             )
          )
       )
    )
    
       )>1,
          ISNUMBER(SEARCH("INV",$G2))),
       "INV",
       IF($B2=112,
       "",
       IF(
          OR(
             LEFT($B2,3)="305",
             LEFT($B2,3)="308",
             LEFT($B2,3)="311",
             LEFT($B2,3)="312",
             LEFT($B2,3)="313",
             LEFT($B2,3)="350"
          ), $H2*10%,
          IF(
             OR(
                LEFT($N2,2)="30",
                LEFT($N2,2)="40"
             ),"",
             IF(
                OR($F2="CM-3000",$F2="CM-4000"),
                "",
                $H2*5%
             )
          )
       )
    )
    )
          

    - to check if all functuions are in 2000;

    - text/number fields to be used correctly

     

    Above is only from editor, didn't check with some values in Excel

17 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    Hi Katie,

     

    Will it be correct to reword rule #5

    ---

    5. If there is an amount in the J column, and there is “INV” in column G MAStat, it puts INV in J instead of amount; If no amount, leave blank

    --

    5. If one of prevous rules return any non-blank value for J and there is “INV” in column G MAStat, we put "INV" in J, otherwise the value returned by previous rules (some number or blank).

     

     

    • katie's avatar
      katie
      Brass Contributor

      Yes, that would be correct

      • SergeiBaklan's avatar
        SergeiBaklan
        Diamond Contributor

        When better to start from the end (for cell J2)

        =IF(
           AND(LEN(
           <previous rules>
           )>1,
              ISNUMBER(SEARCH("INV",$G2))),
           "INV",
           <previous rules>
        )
         

        where <pervious rules> are

        =IF($B2=112,
           "",
           IF(
              OR(
                 LEFT($B2,3)="305",
                 LEFT($B2,3)="308",
                 LEFT($B2,3)="311",
                 LEFT($B2,3)="312",
                 LEFT($B2,3)="313",
                 LEFT($B2,3)="350"
              ), $H2*10%,
              IF(
                 OR(
                    LEFT($N2,2)="30",
                    LEFT($N2,2)="40"
                 ),"",
                 IF(
                    OR($F2="CM-3000",$F2="CM-4000"),
                    "",
                    $H2*5%
                 )
              )
           )
        )

        and finally

        =IF(
           AND(LEN(
           IF($B2=112,
           "",
           IF(
              OR(
                 LEFT($B2,3)="305",
                 LEFT($B2,3)="308",
                 LEFT($B2,3)="311",
                 LEFT($B2,3)="312",
                 LEFT($B2,3)="313",
                 LEFT($B2,3)="350"
              ), $H2*10%,
              IF(
                 OR(
                    LEFT($N2,2)="30",
                    LEFT($N2,2)="40"
                 ),"",
                 IF(
                    OR($F2="CM-3000",$F2="CM-4000"),
                    "",
                    $H2*5%
                 )
              )
           )
        )
        
           )>1,
              ISNUMBER(SEARCH("INV",$G2))),
           "INV",
           IF($B2=112,
           "",
           IF(
              OR(
                 LEFT($B2,3)="305",
                 LEFT($B2,3)="308",
                 LEFT($B2,3)="311",
                 LEFT($B2,3)="312",
                 LEFT($B2,3)="313",
                 LEFT($B2,3)="350"
              ), $H2*10%,
              IF(
                 OR(
                    LEFT($N2,2)="30",
                    LEFT($N2,2)="40"
                 ),"",
                 IF(
                    OR($F2="CM-3000",$F2="CM-4000"),
                    "",
                    $H2*5%
                 )
              )
           )
        )
        )
              

        - to check if all functuions are in 2000;

        - text/number fields to be used correctly

         

        Above is only from editor, didn't check with some values in Excel

Resources