简体   繁体   English

我的产品需要一个 Excel 公式

[英]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.如果产品 (D2) 的价格低于或等于 20,则使用这 3 个条件。 And if the price (D2) is >20 and <=60 then use the conditions for that value.如果价格 (D2) 大于 20 且 <=60,则使用该值的条件。

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.不确定您想对输入的代码中的条件做什么,但您可能可以扩展所提供的嵌套 if 语句。 Replace Then by "value if true" and Else with "value if false" and you basically have the formula you need.将 Then 替换为“value if true”并将 Else 替换为“value if false”,您基本上就拥有了所需的公式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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