Excel - 计算满足多个条件的唯一值 [英] Excel - Count unique values that meets multiple criteria

查看:37
本文介绍了Excel - 计算满足多个条件的唯一值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 5 列:

季度、项目、类型、计数、日期

Quarter, Item, Type, Count, Date

我正在尝试为每个季度提取一个唯一的日期计数物品组合IE.FY20Q3-AU有2个不同的日期,FW20Q3-GLW有1个唯一的日期,FY20Q3-GLE也只有1个唯一的日期

I am trying to pull a UNIQUE count of date for each Quarter & Item combination ie. FY20Q3-AU has 2 different dates, FW20Q3-GLW has 1 unique date, FY20Q3-GLE also has only 1 unique date

有谁知道我如何做到这一点?我已经尝试了几个小时来修改我在网上找到的公式但没有成功.

Does anyone have any idea how I can accomplish this? I have been trying for a few hours modifying formulas that I found online without success.

如果可能,我会尝试在没有数组公式的情况下执行此操作(不确定这是否可行)

If possible, I am trying to do this without an array formula (not sure if that is even possible)

我试过了:

{=SUM(--(FREQUENCY(IF(A:A=A2,MATCH(B:B,B:B,0)),ROW(B:B)-ROW(B2)+1)>0))}

<小时>

| Quarter | Pricelist | Change Type | Item Count | Date    |
|---------|-----------|-------------|------------|---------|
| FY20Q3  | AU        | Type 1      | 1          | 4/18/20 |
| FY20Q3  | AU        | Type 1      | 1220       | 4/4/20  |
| FY20Q3  | CH        | Type 2      | 2          | 4/11/20 |
| FY20Q3  | CH        | Type 1      | 1378       | 4/4/20  |
| FY20Q3  | GLA       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLA       | Type 1      | 1421       | 4/4/20  |
| FY20Q3  | GLB       | Type 1      | 1250       | 4/4/20  |
| FY20Q3  | GLB       | Type 2      | 1          | 4/4/20  |
| FY20Q3  | GLC       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLC       | Type 1      | 1404       | 4/4/20  |
| FY20Q3  | GLH       | Type 2      | 2          | 4/11/20 |
| FY20Q3  | GLH       | Type 1      | 1387       | 4/4/20  |
| FY20Q3  | GLME      | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLME      | Type 1      | 1421       | 4/4/20  |
| FY20Q3  | GLEE      | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLEE      | Type 1      | 1227       | 4/4/20  |
| FY20Q3  | GLEU      | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLO       | Type 1      | 211        | 4/4/20  |
| FY20Q3  | GLK       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLC       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLW       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLU       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | GLZ       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | JP        | Type 1      | 1          | 4/18/20 |
| FY20Q3  | NHI       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | NHI       | Type 1      | 1          | 4/18/20 |
| FY20Q3  | WCH       | Type 2      | 2          | 4/11/20 |
| FY20Q3  | WCH       | Type 2      | 2          | 4/11/20 |

推荐答案

因此,由于您可以访问 O365 并且它是 DA 函数,因此您将不再需要 CSE 输入的公式.您可以使用 UNIQUEFILTER.例如:

So since you got access to O365 and it's DA-functions you would not need a CSE entered formula nomore. You can utilize UNIQUE and FILTER. For example:

=COUNTA(UNIQUE(FILTER(E:E,(A:A=A2)*(B:B=B2))))

我建议您不要使用整列引用以免过多地破坏性能.

Where I would suggest you won't use whole column references to not break down performance too much.

这篇关于Excel - 计算满足多个条件的唯一值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆