简体   繁体   English

Excel复杂公式示例

[英]Excel complex formula example

So I would greatly appreciate your help I'm having quite a struggle. 因此,非常感谢您的帮助,尽管我很努力。 What I need currently is listed below. 我当前需要的是下面列出的。 To begin I have a data set with many individuals and information. 首先,我有一个包含许多个人和信息的数据集。 There are a few columns that I'm interested in. 我感兴趣的是几列。


Table 1: 表格1:

So each Individual is either labeled as Free , Arc 1 , Arc 2 or Arc 3 . 因此,每个Individual都被标记为“ Free ,“ Arc 1 ,“ Arc 2或“ Arc 3 Each individual also has a number of people associated with it and lastly a cost. 每个人也都有许多与之相关的人,最后是成本。

Individual  | # of people  | Cost  | Type | Compliant with Costs?
A           |3             |45     |Free  |Yes/No?
B           |2             |57     |Arc 2 |

Table 2: 表2:

I then have a table below that is broken out. 然后,我在下面有一张桌子。 Free can have 1 2 or 3 individuals and cost can be between 20 - 30 dollars for 1 30-40 for 2 and 40-50 for 3. 免费可以拥有1个2或3个个人,费用为1个30-40(2个)和40-50个(3个)在20-30美元之间。

            |Free  |Arc 1 |Arc2  | Arc 3    
# of people | Cost | Cost | Cost | Cost
1           |20-30 |30-40 | 60-70| 90-100
2           |30-40 |40-50 | 70-80| 100-110
3           |40-50 |60-70 | 80-90| 110-120

So i want to take the Individual column noted above and say if Individual A1 is in Free and has 3 individuals is their cost between 40-50 dollars, if so yes, if not no. 因此,我想接受上面提到的“ Individual列,并说如果“个人A1”处于“免费”状态并且有3个人,则他们的费用在40-50美元之间,如果是的话,如果不是的话。

I know this will use some if formulas probably many, I tried Index(match()) and such too but couldn't figure it out if you could help that would be greatly appreciated. 我知道这会使用一些公式Index(match())如果公式可能很多),我也尝试过Index(match()) ,但也无法弄清楚是否可以帮助您,将不胜感激。

Below is an example of a sample Excel file, it looks easy with just two individuals but there are hundreds so I'm hoping there is an easy formula. 下面是一个示例Excel文件的示例,看起来只有两个人很容易,但是有数百个,因此我希望有一个简单的公式。 Again any help is greatly appreciated. 再次感谢任何帮助。


Excel Screenshot Link (Same as example above) Excel屏幕快照链接 (与上面的示例相同)

If you change your reference table as follows, you can use a sumifs easily to pull the min and the max and see if your cost is in between 如果按以下方式更改参考表,则可以轻松地使用一个求和符来提取最小值和最大值,并查看您的费用是否介于两者之间

#   Type    Min Max
1   Free    20  30
1   Arc 1   60  70
2   Free    30  40

I agree that the best way would be to restructure your reference table, but if you'd like to know how to get your answer as is, you can use a combination of =INDEX(MATCH(),MATCH()) , =LEFT() and =MID() to get your answer, as in the following example: 我同意最好的方法是重组参考表,但是如果您想知道如何直接获得答案,可以使用=INDEX(MATCH(),MATCH())=LEFT()=MID()来获取答案,如以下示例所示:


The formula in E2 is: E2的公式为:

=IF(AND(C2>= (LEFT(INDEX($I$1:$M$5,MATCH(B2,$I$1:$I$5,0),MATCH(D2,$I$1:$M$1,0)),FIND("-",INDEX($I$1:$M$5,MATCH(B2,$I$1:$I$5,0),MATCH(D2,$I$1:$M$1,0)))-1)*1), C2<=MID(INDEX($I$1:$M$5,MATCH(B2,$I$1:$I$5,0),MATCH(D2,$I$1:$M$1,0)),FIND("-",INDEX($I$1:$M$5,MATCH(B2,$I$1:$I$5,0),MATCH(D2,$I$1:$M$1,0)))+1,256)*1),"Yes","No")

在此处输入图片说明 在此处输入图片说明

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

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