简体   繁体   中英

I need an Excel Formula for my products

I need this formula packed as one.

If the price of the product (D2) is lower or equal to 20 then use those 3 conditions. And if the price (D2) is >20 and <=60 then use the conditions for that value.

IF D2<=20 THEN 
    [IF H2=0 AND M2<40 THEN F2+50% 
    ELSE 
    IF H2=0 AND M2>40 THEN F2+100%] 

    [IF M2<40 AND N2>20 THEN F2=0.01 
    ELSE
    IF M2>40 AND N2>40, THEN F2=0.01]

    [IF I2>0 AND M2<40 AND N2<20 THEN F2+20% 
    ELSE
    IF I2>0 AND M2>40 AND N2<40 THEN F2+30%]

IF D2>20 AND D2<=60 THEN 
   [IF H2=0 AND M2<40 THEN F2+50% 
   ELSE 
   IF H2=0 AND M2>40 THEN F2+100%] 

   [IF M2<40 AND N2>20 THEN F2=0.01 
   ELSE
   IF M2>40 AND N2>40, THEN F2=0.01]

   [IF I2>0 AND M2<40 AND N2<20 THEN F2+20% 
   ELSE
   IF I2>0 AND M2>40 AND N2<40 THEN F2+30%]`

Your question would indeed benefit from clarification. This is what you would get if your want to combine the two formulas in your text

=IF(AND(D2<=20,H2=0,M2<40),F2*1.5,IF(AND(D2<=20,H2=0,M2>40),F2*2,IF(AND(D2>20,D2<=60,H2-0,M2<40),F2*1.5,IF(AND(D2>20,D2<=60,H2-0,M2>40),F2*2,"Conditions do not apply"))))

Not sure what you want to do with the conditions in the code you entered but you are likely able to just expand on the nested if statements provided. Replace Then by "value if true" and Else with "value if false" and you basically have the formula you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM