多重匹配得到最差结果

时间:2017-03-27 20:09:32

标签: excel

所以我很难弄清楚我应该在报告中使用什么。我知道它应该是嵌套的,但是我真的无法弄明白我应该怎么做。我需要确定是否有:

Delivered
Called Out
Partially Called Out
Forecasted
Partially Ordered
Not Ordered (this would simply be, if no matches, it wasn't ordered)

问题在于可能存在多个具有相同ID号的订单(因为每个ID具有多个部分)。所以我需要的是一种方法,让它看看所有相同的ID号,并给我最后的结果。例如,如果我有4个相同的ID' s结果:

Delivered
Delivered
Partially Called Out
Partially Ordered

公式的结果会给我" Partially Ordered"因为这是最糟糕的结果。

所以基本上,我正在寻找多个相同ID的最差订单状态

我从

开始
=IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))=0,"Not Ordered",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Partially Ordered","Partially Ordered",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Forecasted","Forecasted",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Partiially Called Out","Partially Called out",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Called Out","Called Out",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Delivered","Delivered"))))))

但这并没有让我得到我想要的东西,而且我相当确定那里有更好的方法......

1 个答案:

答案 0 :(得分:1)

使用类似这样的数组公式:

{}

作为数组公式,需要在退出编辑模式而不是Enter时使用Ctrl-Shift-Enter确认。如果操作正确,那么Excel会将bool readini() { // Load .ini file and retrieve ClientGuid ** CSimpleIniA ini; ini.SetUnicode(); ini.LoadFile("C:\\test\\CppWindowsService.ini"); const char * pVal = ini.GetValue("GUID", "Clientguid", NULL); std::cout << "pVal:" << pVal << std::endl; std::string test(pVal); // Had to convert pVal to string for unknow reason: if (test == "noguid") // const char * "noguid" != const char[7] "noguid" ??? { // Aren't these the exact same thing?... Compiler wasn't // generate guid ** // throwing the error, but the if statement wouldn't pass GUID initguid; // the condition until I did this. HRESULT hCreateGuid = CoCreateGuid(&initguid); // generate bstr from guid ** wchar_t* bstrGuid; StringFromCLSID(initguid, &bstrGuid); std::wcout << bstrGuid << std::endl; // transform bstr to str ** std::stringstream ss; ss << bstrGuid; std::string guid = ss.str(); // set .ini clientguid with generated guid ** SI_Error rc = ini.SetValue("GUID", "Clientguid", guid.c_str()); if (rc < 0) { return false; } printf("key: %s\n", rc == SI_INSERTED ? "inserted" : "updated"); ::CoTaskMemFree(bstrGuid); } } 放在公式周围。

这假定列表按最佳状态排列。

enter image description here