Excel数组公式IF(多重条件) [英] Excel Array formula IF(multiple criteria)

查看:1397
本文介绍了Excel数组公式IF(多重条件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的电子表格中,比较耳机,我们的教学基本上是尽可能多地使用不同的公式。



所以作为电子表格的一部分,我想能够显示每个制造商最昂贵的耳机,每个制造商最便宜,最优惠每个制造商等...
到目前为止,我已经能够得到一些主要工作的数组公式。



例如,这个公式用于获取

  = INDEX($ Data。$ B $ 5 :$ L $ 32,SMALL($($ Data。$ E $ 5:$ E $ 32 = $ Sheet2.D17,ROW($ Data。$ B $ 5:$ E $ 32) -  ROW($ Data。$ B $ 5)+ 1 ,ROW($ Data。$ E $ 32)+ 1),1),2)

列E是价格栏,D17是森海塞尔的预先计算的最高价格。



这样可以正常运行,直到你得到2个具有相同价格/等级的耳机。那么它开始返回错误的值。



所以我尝试了我在interwebs上找到的各种解决方案,如

  AND(condition1,condition2)
condition1 * AND(cndition2)
condition1 * condition2

但是由于某些原因,这些都不能用于数组公式。我得到#N / A或#VALUE和其他各种错误。
SO基本上我想知道如何修改我的公式,甚至是一个全新的公式,以检查最低价格和正确的制造商。



I希望我的问题很清楚,所以我已经上传了这个电子表格来了解我在说什么。



http://dl.dropbox.com/u/18816338/Stats%20Analysis%20%20%281 %29.xlsm



提前感谢

解决方案

通常AND不会在这里工作,因为AND返回单个结果而不是数组....但是*应该是OK的,即在B3中尝试这个公式

= INDEX(数据C $ 5:!C $ 32 MATCH(1,(数据$ E $ 5:!$ E $ 32 = $ D3)*(数据$ B $ 5:!$ B $ 32 = $ A3), 0))



使用CTRL + SHIFT + ENTER确认并复制到C3,然后同时按两列



这将找到价格和制造商的第一场比赛,并返回相关的模型/类型


In my spreadsheet, comparing headphones, our instruction is basically to use as many different formulas as possible.

So as part of the spreadsheet, I would like to be able to show the most expensive headphones per manufacturer, cheapest per manufacturer, best rated per manufacturer etc... So far I have been able to get some mostly working array formulas.

For example, this formula works to get the model of the manufacturer "Sennheiser" with the highest price:

=INDEX($Data.$B$5:$L$32,SMALL(IF($Data.$E$5:$E$32 = $Sheet2.D17, ROW($Data.$B$5:$E$32) - ROW($Data.$B$5) + 1, ROW($Data.$E$32) + 1), 1), 2)

Column E is the Price column and D17 is a pre-calculated Max price for "sennheiser"

This works fine, until you get 2 headphones with the same price / rating or whatever. THen it starts returning the wrong values.

So I tried various solutions that I found on the interwebs, like

AND(condition1, condition2) 
condition1 * AND(cndition2)
condition1 * condition2

but none of this seems to work with an array formula for some reason. I get #N/A or #VALUE and various other errors. SO basically I would like to know how to modify my formula, or even a completely new formula, to check for lowest price AND the correct manufacturer.

I hope my question is clear, so I have uploaded the spreadsheet to get some idea of what I am talking about.

http://dl.dropbox.com/u/18816338/Stats%20Analysis%20%20%281%29.xlsm

Thanks in advance

解决方案

Typically AND won't work here because AND returns a single result rather than an array....but * should be OK, i.e. try this formula in B3

=INDEX(Data!C$5:C$32,MATCH(1,(Data!$E$5:$E$32=$D3)*(Data!$B$5:$B$32=$A3),0))

confirmed with CTRL+SHIFT+ENTER and copied to C3 and then down both columns

That will find the first match for both price and manufacturer and return the relevant model/type

这篇关于Excel数组公式IF(多重条件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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