计数在excel中查找值

时间:2017-02-03 18:51:33

标签: excel-formula

我有一个缺陷列表,其中包含零件号和缺陷代码

public static void SetLevel(string loggerName, string levelName)
{
    ILog log = LogManager.GetLogger(loggerName);
    Logger l = (Logger)log.Logger;

    l.Level = l.Hierarchy.LevelMap[levelName];
}

// Add an appender to a logger
public static void AddAppender(string loggerName, IAppender appender)
{
    ILog log = LogManager.GetLogger(loggerName);
    Logger l = (Logger)log.Logger;

    l.AddAppender(appender);
    l.Repository.Configured = true;
}

// Create a new file appender
public static IAppender CreateSeqAppender(string name)
{
    var seqAppender = new SeqAppender();
    seqAppender.ServerUrl = ConfigurationManager.AppSettings["Seq:Url"];
    var seqApiKey = ConfigurationManager.AppSettings["Seq:ApiKey"];
    if (seqApiKey != null)
    {
        seqAppender.ApiKey = seqApiKey;
    }
    PatternLayout patternLayout = new PatternLayout();

    var LOG_PATTERN = "%d [%t] %-5p %m%n";
    patternLayout.ConversionPattern = LOG_PATTERN;
    patternLayout.ActivateOptions();
    seqAppender.Name = name;
    seqAppender.BufferSize = 1;
    seqAppender.Layout = patternLayout;
    seqAppender.ActivateOptions();

    return seqAppender;
}

static void Main()
{
    BasicConfigurator.Configure();
    // In order to set the level for a logger and add an appender reference you
    // can then use the following calls:
    SetLevel("Log4net.MainForm", "ALL");
    AddAppender("Log4net.MainForm", CreateSeqAppender("SeqAppender"));

    //BasicConfigurator.Configure();

    var logger = LogManager.GetLogger("MyLogger");

    logger.Info("This is a test log message");
}

现在我想计算除了每个刀片号码的缺陷代码TE之外的缺陷。

2 个答案:

答案 0 :(得分:0)

使用数据透视表并过滤掉TE

SO42031121 example

答案 1 :(得分:0)

COUNTIFS function可以接受匹配或不匹配的条件。

=COUNTIFS(A$2:A$13, D2, B$2:B$13, "<>TE")

enter image description here